[ Rodja_ki @ 16.09.2012. 11:44 ] @
Moze li mi neko reci kako se zove ovaj efekat? http://www.yourinspirationweb....inspiration-folio_en/index.htm Kada se klikne na neku stavku iz menija sadrzaj strane prosto klizi...kako se to radi? |
[ Rodja_ki @ 16.09.2012. 11:44 ] @
[ Igor Gajic @ 16.09.2012. 13:55 ] @
To je najobicniji anchor tag/link.
Koristi animate funkciju da dodje do odgovarajuceg elementa: Code (javascript): jQuery(document).ready(function(){ jQuery('#nav a[href*=#]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var $target = jQuery(this.hash); $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']'); if ($target.length) { var targetOffset = $target.offset().top; jQuery('html,body') .animate({scrollTop: targetOffset}, 1000); return false; } } }); }); Btw. Use the Firebug, my young padawan ![]() [ Rodja_ki @ 17.09.2012. 10:45 ] @
Koristim ja Firebug, nije problem, ali sam slab sa javascriptom, pa otud pitanje kako to funkcionise...a anchor nema to klizanje :)
Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|