{"id":1194,"date":"2013-10-04T04:21:15","date_gmt":"2013-10-04T04:21:15","guid":{"rendered":"http:\/\/musilda.cz\/?p=1194"},"modified":"2013-10-04T04:21:15","modified_gmt":"2013-10-04T04:21:15","slug":"scroll-to-top-odkaz-jquery","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/scroll-to-top-odkaz-jquery\/","title":{"rendered":"Scroll to top odkaz jQuery"},"content":{"rendered":"\n
N\u011bkter\u00e9 WordPress \u0161ablony maj\u00ed tu nep\u0159\u00edjemnou vlastnost, \u017ee v\u00fdpis \u010dl\u00e1nk\u016f je dlouh\u00fd a v pati\u010dce nejsou \u017e\u00e1dn\u00e9 naviga\u010dn\u00ed prvky. Mus\u00edte pak scrollovat celou str\u00e1nkou a\u017e zp\u011bt na za\u010d\u00e1tek, aby jste se dostali k menu a dal\u0161\u00ed nab\u00eddce \u010dl\u00e1nk\u016f. Proto si dne uk\u00e1\u017eeme jednoduch\u00fd postup, jak p\u0159idat do pati\u010dky odkaz, kter\u00fd v\u00e1s vr\u00e1t\u00ed na za\u010d\u00e1tek str\u00e1nky.<\/p>\n\n\n\n
Nejjednodu\u0161\u0161\u00ed postup je vytvo\u0159it takzvanou kotvu a po kliknut\u00ed se str\u00e1nka p\u0159esune na m\u00edsto kotvy. Tagu body p\u0159id\u00e1me id=“frame“ a odkazovat na n\u011bj budeme pomoc\u00ed href=“#frame“. To je ale jen p\u0159\u00edklad, kter\u00fd nepou\u017eijeme, proto\u017ee p\u0159esun je okam\u017eit\u00fd a p\u016fsob\u00ed nep\u0159\u00edjemn\u011b.<\/p>\n\n\n\n
Vytvo\u0159\u00edme si tedy v pati\u010dce odkaz, nebo ikonku, m\u016f\u017ee vypadat t\u0159eba takto:<\/p>\n\n\n\n