I have a problem on my development website www.depcore.com/v4 I have a form with a slider plugin.
I wanted to be as easy as possible so I used a slider plugin for the budget.
After sending the form I replace it with a thank you/info message with the ability to resend it.
The base form is stored in a variable.
Here is the fragment that sends and replaces the form
$.ajax({开发者_如何学Go
type: "POST",
url: "process.php",
data: dataString,
success: function() {
$('#contactForm').html("<div id='message-sent'></div>");
$('#message-sent').html("<div><h2>Thank you</h2> <p>The message was sent. I'll get back to you as soon as possible</p></div><p><a href='#'>Send another</a></p></div>").hide().fadeIn(1500);
$('#message-sent a').live('click',function(){
$('#contactForm').html(formF).fadeIn(1500); return false;
jQuery("#budget").slider({ from: 100, to: 10000, step: 100, scale: [100, '|', 2500, '|' , '5000', '|', 7500, '|', 10000],
round: 1, dimension: ' $'});
});
}
});
I guess it has to do with the live function and is probably very easy, but couldn't make much sens out of the documentation.
thanks for any help
Removing the return false;
within your live()
before jQuery("#budget").slider(...)
should solve the problem.
But you don't have to use live
in your case, because you are explicitly setting the slider in your success
handler. You can use .click()
here. You could use $('#message-sent a').live(...)
in some "global code".
精彩评论