Sunday, 15 April 2012

javascript - How do I modify this e.preventDefault to work on all pages except the homepage? -



javascript - How do I modify this e.preventDefault to work on all pages except the homepage? -

i'm having problem bit of script in getting colorbox work on site.

originally coded override default link follow 'launch(this);' whenever class .boxelement found on link.

i've tried modify override happens when not homepage, doesn't seem trigger. instead prevents override on pages.

$('.' + boxelement, document).live('click', function (e) { if ( !is_home() ) { e.preventdefault(); launch(this); } else { homecoming true; } });

could provide assistance? i'm sure simple mistake.

this function should homecoming true home page

var is_home = function(){ homecoming window.location.href.indexof("some_part_of_home_url") > -1; }

javascript jquery wordpress colorbox

No comments:

Post a Comment