• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Block container oddly overlapping.

#1
I custom coded a block on my sidebar, and for some reason it is overlapping the blocks underneath it. I can't quite see anything in my code that would make it do this although maybe someone has an idea what could be causing this. The block is the one containing the voting buttons.



Code:
<?xml version="1.0" encoding="utf-8"?>
<block block_id="VoteBlock" title="VoteBlock" version_string="1.0.0" version_id="1" url="" install_callback_class="" install_callback_method="" uninstall_callback_class="" uninstall_callback_method="" cache="now">
  <admin_templates/>
  <listeners/>
  <options/>
  <phrases/>
  <route_prefixes/>
  <templates>
    <template title="EWRblock_VoteBlock"><![CDATA[<div class="section"><div class="secondaryContent" id="HtmlBlock">
        <div>
        <h3>Vote For CraftGasm</h3>
        <div>
          <p>Vote for Portal blocks to earn great rewards online our servers!</p>
        </div>
    <script type="text/javascript">
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_1','','/images/vote_button_mouseover1.png',1)"><img src="/images/vote_button1.png" width="180" height="44" id="Vote_1" /></a>
</div>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_2','','/images/vote_button_mouseover2.png',1)"><img src="/images/vote_button2.png" width="180" height="44" id="Vote_2" /></a>
</div>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_3','','/images/vote_button_mouseover3.png',1)"><img src="/images/vote_button3.png" width="180" height="44" id="Vote_3" /></a>
</div>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_4','','/images/vote_button_mouseover4.png',1)"><img src="/images/vote_button4.png" width="180" height="44" id="Vote_4" /></a>
</div>
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_5','','/images/vote_button_mouseover5.png',1)"><img src="/images/vote_button5.png" width="180" height="44" id="Vote_5" /></a>
</div>
</div>]]>
</template>
  </templates>
</block>
 

EQnoble

Well-known member
#2
I custom coded a block on my sidebar, and for some reason it is overlapping the blocks underneath it. I can't quite see anything in my code that would make it do this although maybe someone has an idea what could be causing this. The block is the one containing the voting buttons.



Code:
<?xml version="1.0" encoding="utf-8"?>
<block block_id="VoteBlock" title="VoteBlock" version_string="1.0.0" version_id="1" url="" install_callback_class="" install_callback_method="" uninstall_callback_class="" uninstall_callback_method="" cache="now">
  <admin_templates/>
  <listeners/>
  <options/>
  <phrases/>
  <route_prefixes/>
  <templates>
    <template title="EWRblock_VoteBlock"><![CDATA[<div class="section"><div class="secondaryContent" id="HtmlBlock">
        <div>
        <h3>Vote For CraftGasm</h3>
        <div>
          <p>Vote for Portal blocks to earn great rewards online our servers!</p>
        </div>
    <script type="text/javascript">
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_1','','/images/vote_button_mouseover1.png',1)"><img src="/images/vote_button1.png" width="180" height="44" id="Vote_1" /></a>
</div>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_2','','/images/vote_button_mouseover2.png',1)"><img src="/images/vote_button2.png" width="180" height="44" id="Vote_2" /></a>
</div>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_3','','/images/vote_button_mouseover3.png',1)"><img src="/images/vote_button3.png" width="180" height="44" id="Vote_3" /></a>
</div>
 
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_4','','/images/vote_button_mouseover4.png',1)"><img src="/images/vote_button4.png" width="180" height="44" id="Vote_4" /></a>
</div>
<div>
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_5','','/images/vote_button_mouseover5.png',1)"><img src="/images/vote_button5.png" width="180" height="44" id="Vote_5" /></a>
</div>
</div>]]>
</template>
  </templates>
</block>


I mean I don't know how it is supposed to be setup for a porta block but as far as html goes you are missing two closing tags it would seem.


try adding </div></div> near the end of the template

find this...
Code:
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_5','','/images/vote_button_mouseover5.png',1)"><img src="/images/vote_button5.png" width="180" height="44" id="Vote_5" /></a>
</div>
</div>]]>
</template>
  </templates>

Add it like this...
Code:
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_5','','/images/vote_button_mouseover5.png',1)"><img src="/images/vote_button5.png" width="180" height="44" id="Vote_5" /></a>
</div>
</div></div></div>]]>
</template>
  </templates>
I guess there since it looks like your block isn't closing and it is including then next block in it...

Let me know if that does anything for you
 
#4
I mean I don't know how it is supposed to be setup for a porta block but as far as html goes you are missing two closing tags it would seem.


try adding </div></div> near the end of the template

find this...
Code:
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_5','','/images/vote_button_mouseover5.png',1)"><img src="/images/vote_button5.png" width="180" height="44" id="Vote_5" /></a>
</div>
</div>]]>
</template>
  </templates>

Add it like this...
Code:
<a href="LINK_URL_HERE" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Vote_5','','/images/vote_button_mouseover5.png',1)"><img src="/images/vote_button5.png" width="180" height="44" id="Vote_5" /></a>
</div>
</div></div></div>]]>
</template>
  </templates>
I guess there since it looks like your block isn't closing and it is including then next block in it...

Let me know if that does anything for you
It worked, it was probably continuing the container because the missing tag. Thanks!