Page 1 of 1

Trouble inserting html-code in nugget...

Posted: Sun May 20, 2007 9:22 pm
by superu
Hello forum,
i have some trouble inserting certain html-code in an html-nugget. i like to have a java-scrip menue. In pure html, this works perfect for me:

Code: Select all

<script type="text/javascript">

var block=0,submenu,i,image_nr,row,row2,x,y=0;

if (document.getElementById){
    document.write('<style type="text/css">\n');
    document.write('.submenu{display: none;}\n');
    document.write('</style>\n');

    function SwitchMenu(title,obj){

        image_nr = obj.substring(3);
        submenu = document.getElementById(obj);
        row = document.getElementById("masterdiv").getElementsByTagName("span");
        row2 = document.getElementById("masterdiv").getElementsByTagName("div");

        if(submenu.style.display == "block"){
                block = 1;
        }else{
                block = 0;
        }

        for(i=0; i<row.length; i++){
            if (row[i].className=="submenu"){
                row[i].style.display = "none";
            }
        }

        for(x=0; x<row2.length; x++){
            if (row2[x].className=="menutitle"){
                y += 1;
                image = document.createElement("img");
                image.src = "images/cat"+y+"_normal.gif";
                row2[x].replaceChild(image, row2[x].firstChild);
            }
        }
        y = 0;

        if(!block){
            submenu.style.display = "block";

            image = document.createElement("img");
            image.src = "images/cat"+image_nr+"_over.gif";
            title.replaceChild(image, title.firstChild);
        }
    }
}
</script><style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
}
-->
</style>

<div id="masterdiv">

    <div class="menutitle" onclick="SwitchMenu(this,'sub1')"><img src="images/cat1_normal.gif" border="0" > MenueOne</div>
    <div>
     <span class="submenu" id="sub1">
      <table cellpadding="0" cellspacing="0" border="0" style="width: 180px; margin-left: 15px;">
       <tr><td align="left" style="width: 100%;"><img src="images/open.gif" border="0"> <a href="link1.php" class="menu">pointone</a></td></tr>
       <tr><td align="left" style="width: 100%;"><img src="images/open.gif" border="0"> <a href="link2.php" class="menu">pointtwo</a></td></tr>
       <tr><td align="left" style="width: 100%;"><img src="images/open.gif" border="0"> <a href="link3.php" class="menu">pointthree</a></td></tr>
     </table>
     </span>
    </div>

    <div class="menutitle" onclick="SwitchMenu(this,'sub2')"><img src="images/cat2_normal.gif" border="0"> MenueTwo</div>
    <div>
     <span class="submenu" id="sub2">
      <table cellpadding="0" cellspacing="0" border="0" style="width: 180px; margin-left: 15px;">
       <tr><td align="left" style="width: 100%;"><img src="images/open.gif" border="0"> <a href="link4.php" class="menu">pointone</a></td></tr>
       <tr><td align="left" style="width: 100%;"><img src="images/open.gif" border="0"> <a href="link5.php" class="menu">pointtwo</a></td></tr>
       <tr><td align="left" style="width: 100%;"><img src="images/open.gif" border="0"> <a href="link6.php" class="menu">pointthree</a></td></tr> 
     </table>
     </span>
    </div>

</div>
But in a html-nugget, strange things happen:
The menue-Headlines ("MenueOne" and "MenueTwo") disappear after klicking on them. Then, the "Left Margin" tag is ignored. Can anyone help me with this? Thank you!!
Greetings, Ullrich

Posted: Mon May 21, 2007 12:58 am
by d_cee
Hi

my only suggestion is to make sure that you have the 'Perform Markup Transformations ' NO checkbox checked in the html nugget

HTH

Dave

Posted: Mon May 21, 2007 10:06 pm
by judebert
Check the page source and verify that it matches the HTML you put in the nugget. If not, make sure you've got the markup transformations off, just like d_cee said. If that doesn't work, you may have a conflicting plugin.