Jump to content

Modalbox Mod help


darkfreaks

Recommended Posts

okay so what i am doing is using a modalbox popup for my application. however i want to change the stylesheet  color meaning i would have to use more than one CSS stylesheet. the tricky part is coming up with a way to apply the changes so that it works without closing the modalbox popup when you click on the link it will change the theme according to the color link.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/179111-modalbox-mod-help/
Share on other sites

okay i found a function that will switch the stylesheet but it wont work with modal as it currently is. it will just make the page reload with the default modal stylesheet. :wtf:

code:

<script type="text/javascript">

function changeActiveStyleSheet(previous, new)
{
if(document.styleSheets)
{
for (var StyleSheetIterator = 0; StyleSheetIterator <
document.styleSheets.length; StyleSheetIterator++)
{
if(document.styleSheets[styleSheetIterator].title == previous)
{
document.styleSheets[styleSheetIterator].disabled = true;
};
if(document.styleSheets[styleSheetIterator].title == new)
{
document.styleSheets[styleSheetIterator].disabled = false;
};
};
};
}

</script>
<script type="text/javascript" src="ajax.js"></script> 
<link rel="stylesheet" href="modalbox.css" title="Original Purple" type="text/css" 
media="screen" />
<link rel="stylesheet" href="orange.css" title="Orange Flavor" type="text/css" 
media="screen" />
<div id="links"><a href="" onclick="changeActiveStyleSheet('Orange Flavor', 'Original Purple');">Original Purple</a>|<a href="" onclick="changeActiveStyleSheet('Original Purple', 'Orange Flavor');">Orange Flavor</a></div>

Link to comment
https://forums.phpfreaks.com/topic/179111-modalbox-mod-help/#findComment-945578
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.