Rewrite Jquery to Regular Javascript -
how rewrite below code in regular javascript. dont want load jquery library.
$(document).ready( function() { $('.navigation li').click(function() { $('.navigation li').removeclass('navactive'); $(this).addclass("navactive"); bgimage = $(this).find('a').attr('href').replace('#', '')+'.jpg'; $('.background').css("background-image", 'url(images/skins/'+bgimage+')'); }); });
the jquery library complex, , lot of stuff behind scenes. accurately answer question you'd need give bit more information, such as:
which browsers planning on supporting? jquery @ staying cross browser compatible, relies on hacky things this. ideally don't want include things in own code, it's better hide them away in library.
do have control on page? rewrite treat navigation control, have things image url in variable, rather having 'extract' <a />
tag?
Comments
Post a Comment