6

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>");            
});
4

1 に答える 1

1

jQuery .live()関数で試してください

$(function() {
    $(".whis").live("click", function(){
        $("#header .links #wishlist-total").wrapInner("<span/>");
    });
});
于 2012-11-28T04:55:33.193 に答える