Help using SimpleModal plugin (JQUERY)
Hello.
I generate dynamically a block using a loop with smarty, my problem is that I need to pass a parameter to the simplemodal windows that the user open when do click on the button or link, and this parameter is different for each loop.
-
- {for i=0; i = 10; i++}
- <div id='contact-form'>
- CHANGE $i <input type='button' name='contact' value='Demo' class='contact demo'/> or <a href='#' class='contact'>Demo</a>
- </div>
- {/for}
This is the javascript code that call "solicitar_cambio.html" .... I need to pass a variable to this file, GET or POST, it is the same, but I dont know how to do it.
- $(document).ready(function () {
$('#contact-form input.contact, #contact-form a.contact').click(function (e) {
e.preventDefault();
// load the contact form using ajax
$.get("solicitar_cambio.html", function(data){
// create a modal dialog with the data
$(data).modal({
closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
position: ["15%",],
overlayId: 'contact-overlay',
containerId: 'contact-container',
onOpen: contact.open,
onShow: contact.show,
onClose: contact.close
});
});
});
- // preload images
var img = ['cancel.png', 'form_bottom.gif', 'form_top.gif', 'loading.gif', 'send.png'];
$(img).each(function () {
var i = new Image();
i.src = 'img/contact/' + this;
});
});
How can I do it??
Thanks a million