jquery - How can I keep this appended DIV in place after "price" changes? -
jquery - How can I keep this appended DIV in place after "price" changes? -
i designing site on custom built cms, developed old job:
http://dev544.webdugout.com/view/snow-removal
in order me move cost div "productprice" bottom of page, used following:
$(".productprice").appendto(".productpricecontainer");
i used next add together text in front end of numeric price:
$( ".productprice" ).prepend( '<h2><span>4</span> total cost be</h2>');
everything looks great, though 1 time take option, changes price, div goes it's original position in code , removes text added. way can resolve jquery , without having approach programmer this?
thanks!
the reason elements moving top because original position in dom when page first loaded. when select item dropdown page performing postback , javascript not called again. seek using code below. should cause javascript called each time perform postback.
function pageload() { bindjqueryevents(); $(".productprice").prepend('<h2><span>4</span> total cost be</h2>'); } //re-bind callbacks var prm = sys.webforms.pagerequestmanager.getinstance(); prm.add_endrequest(function () { bindjqueryevents(); }); function bindjqueryevents() { $(".productprice").appendto(".productpricecontainer"); }
jquery css prepend appendto
Comments
Post a Comment