Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Reference this page: http://www.ivault.sg/nproduct.php?pid=116&cat=2

Selecting an option on the dropdown box by the side should change the href of 'Add to Cart'.

However this does not happen specifically on Chrome on Macs, but works on all other browsers, even on Chrome in Windows.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Instead of the "click" event, use "change", as in

$("#productOptions").change(function(){
    var id=$(this).attr("value");

    if (id != "") {
        $("#productAddToCart").attr("href","addtocart.php?code="+id);
    }
});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...