I would like to implement several Modals instead of just 1.
I’ve run into a problem because I would like to call the same jQuery(function ($) { }
This function is only set-up for a single named Anchor “consultcontacto” for this modal: modal-contact-form
However, I need to utilize a 2nd Anchor “suportecontacto” and then enable an entirely different modal: modal-contact-form2
Here is the Fiddle with the 2 Anchors however the JavaScript Function is only set-up for the the Anchor named “consultcontacto”:
http://jsfiddle.net/NinjaSk8ter/TEUsx/
I’m not sure if I would need to implement an entirely different function or just modify jQuery(function ($) { }
within WebGrupoDotNet.aspx is definition for 2 seperate Anchor Buttons:
<div id="Soluciones_derecho2">
<div class="contactanos">
<div id="contact-button">
<div id='contact-form'>
<a class="consultcontacto" href="#"></a>
<a class="suportecontacto" href="#"></a>
</div>
</div>
</div>
</div
within soluciones.css:
#contact-button {
height: 40px;
width: 220px;
float: left;
position:relative;
margin: 7px 0 0 5px;
}
a.consultcontacto {
height: 40px;
width: 220px;
background-image: url("/images/Home/consultbuton3.png");
background-position:left bottom; /* 0px -27px; */
display: block;
font-size: 11px;
text-align: center;
}
a.consultcontacto:hover {
/*background-position:left top; /*0px 0px;*/
}
a.suportecontacto {
height: 40px;
width: 220px;
margin: 6px 0 0 0;
background-image: url("/images/Home/soportebuton2.png");
background-position:left bottom; /* 0px -27px; */
display: block;
font-size: 11px;
text-align: center;
}
a.suportecontact:hover {
}
within contact.js, you can see where the function only enables for the single:
modal-contact-form:
jQuery(function ($) {
var contact = {
message: null,
init: function () {
$('#contact-form input.consultcontacto, a.consultcontacto').click(function (e) {
e.preventDefault();
// Create the Modal dialog with the data
$('#modal-contact-form').modal({
closeHTML: "<a href='#' title='Close' class='modal-close'>Cierra Ticket Modal</a>",
maxHeight: 62,
maxWidth: 62,
minHeight: 62,
minWidth: 62,
position: [138, 383],
overlayId: 'contact-overlay',
containerId: 'contact-container',
onOpen: contact.open,
onShow: contact.show,
onClose: contact.close
});
});
},
This fiddle only changes the name:
http://jsfiddle.net/rwtuH/5/
You had two :hover selectors and no .consultcontacto styling at all! I also went ahead and updated the contact var to be consultcontacto.
Here is a fiddle and code that has both contact and consultcontacto:
http://jsfiddle.net/rwtuH/3/
JS
HTML
CSS