Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrap span in wishlist link of header part in opencart

I want to wrap a span on wishlist link of header part in my opencart theme.

I have tried the following attempts but not succeeded any one can suggest the better way?

THIS WORKS BUT ONLY WRAPS THE SPAN FOR A SECOND AND THEN AGAIN COMES TO IT DEFAULT STATE. A CLASS(whis) IS ADDED TO 'ADD TO WISHLIST' LINK

$(document).ready(function(e) {
    $('.whis').click(function(){
        $("#header .links #wishlist-total").wrapInner("<span></span>");     
    });
});

THIS WORKS UNTILL it is clicked on 'Add to wishlist' link of product.

$(document).ready(function(e) {
     $("#header .links #wishlist-total").wrapInner("<span></span>");            
});
like image 587
matthewb Avatar asked Nov 27 '12 14:11

matthewb


1 Answers

Try with jQuery .live() function

$(function() {
    $(".whis").live("click", function(){
        $("#header .links #wishlist-total").wrapInner("<span/>");
    });
});
like image 189
arunes Avatar answered Oct 23 '22 13:10

arunes