Skip to content Skip to sidebar Skip to footer

Show Div Or Section After Redirecting To Html Page

I am having a problem with regards with showing DIV or section after redirecting to page, I am using magento custom page, so basically it is pure html. Here's my code: 1st page: 1s

Solution 1:

Add a javascript to hide the div with id 'secondpage_2nd-div' in second page!

<script>
    element=document.getElementById("secondpage_2nd-div");
    element.style.display = 'none';           // Hide//element.style.display = 'block';          // Show</script>

Else, there are many div in page, hide all the divs and show only one desired,

<script>var divs = ​document.getElementsByTagName("div");​
    for (var i = 0; i < divs.length; i++) {
      divs[i].style.display = 'none';        
    }
</script>

and then

<script>
    element=document.getElementById("secondpage_1st-div");
    element.style.display = 'block';           // show one div
</script

It totally depends on your requirement. Hope it helps!

Post a Comment for "Show Div Or Section After Redirecting To Html Page"