Closed GoogleCodeExporter closed 8 years ago
For that you have to use the method directCall.data:
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function(){
jQuery.fn.modalBox({
directCall: {
data : '<div class="testclass"><p>test</p></div>'
}
});
});
/* ]]> */
</script>
Original comment by steffen....@googlemail.com
on 18 Sep 2012 at 1:42
Yes, I saw that. But I don't want to put a lot HTML in my Javascript Files.
There is also a lot of generated stuff within that Layer.
Or is it possible to hand an Object as data, instead of a string?
Original comment by fwebdev
on 18 Sep 2012 at 1:44
Sure. Put your HTML to a string like:
var myHTMLCOntent = '<div class="testclass"><p>test</p></div>';
jQuery.fn.modalBox({
directCall: {
data : myHTMLCOntent
}
});
Original comment by steffen....@googlemail.com
on 18 Sep 2012 at 1:46
Hm... OK.
But thats not what I need.
I store an Element from the DOM in myContent and I see the Layer.
var myContent = $j("#ps_offerLayerModal").html();
But the original DOM Element still remains on the page.
Your solution is just working if I keep the original Element completly out of
DOM.
But thats not possible because the HTML is generated and filled with
Backendinformation. :(
Original comment by fwebdev
on 18 Sep 2012 at 1:56
Use class over ID. Solution:
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function(){
jQuery.fn.modalBox({
directCall: {
data : $(".ps_offerLayerModal").eq(2).html();
}
});
});
/* ]]> */
</script>
Original comment by steffen....@googlemail.com
on 18 Sep 2012 at 2:07
I think I have to use my Solution because I have nearly 100 exisiting Modalbox
(created for a prototype/scriptaculous World) that I have to migrate over the
time.
I don't want to change all the CSS/JS Bindings to switch from IDs to Classes.
But thank you for your quick responses.
Original comment by fwebdev
on 18 Sep 2012 at 2:11
Yes, it exist a lot of solution for modal boxes. The best of all is Lightbox:
http://en.wikipedia.org/wiki/Lightbox_%28JavaScript%29
But you are going to declare that all solutions can't supply all your
requirements.
Best Regards,
Steffen
Original comment by steffen....@googlemail.com
on 18 Sep 2012 at 2:42
Noooo :-)
But I like your solution a lot.
Small, good readable source with nice callbacks and a simple way to Theme it :-)
Lightbox brings to much stuff with it.
Original comment by fwebdev
on 18 Sep 2012 at 2:47
Thank you. I think my solution for modal boxes are most usable for professional
developers. Lightbox or other are whole lot simpler.
Best Regards,
Steffen
Original comment by steffen....@googlemail.com
on 18 Sep 2012 at 3:29
Original issue reported on code.google.com by
fwebdev
on 18 Sep 2012 at 1:19Attachments: