Hello CodingForum,
There are various widgets and plugins that show link preview via tooltip or iframe,
So as I am trying to continuously improve web sites experience with new trends and web
functionalities - thus it come the task for uniform link preview via div and iframe.
This is the script that use attribute id's but for the complete solution it would be required to
display link within event 'this' or something -any suggestions and help are very appreciated.
Thanks
<div id="panel1" class="panel">
<h2>Panel 1</h2>
This panel starts closed because style='display:none' is defined in
the style section of the head
</div>
<div class="toggle"><a href="javascript:toggleDiv('panel2');" >Toggle
Panel 2</a></div>
<div id="panel2" class="panel" style="display:block;">
<h2>Panel 1</h2>
This panel starts open because of style='display:block'
</div>
<a href="javascript:toggleDiv('panel1');" >Another Link to Toggle Panel
1</a>
[/CODE]
There are various widgets and plugins that show link preview via tooltip or iframe,
So as I am trying to continuously improve web sites experience with new trends and web
functionalities - thus it come the task for uniform link preview via div and iframe.
This is the script that use attribute id's but for the complete solution it would be required to
display link within event 'this' or something -any suggestions and help are very appreciated.
Thanks
Code:
<script type="text/javascript"> function toggleDiv(divid){ var div = document.getElementById(divid); div.style.display = div.style.display == 'block' ? 'none' : 'block'; } </script> <div class="toggle"><a href="javascript:toggleDiv('panel1');" >Toggle Panel 1</a></div> <div id="panel1" class="panel"> <h2>Panel 1</h2> This panel contains text </div> <div class="toggle"><a href="javascript:toggleDiv('panel2');" >Toggle Panel 2</a></div> <div id="panel2" class="panel" style="display:block;"> <h2>Panel 2</h2> This panel contains external url content <iframe src="http://" width="100%" heigth="500"></iframe> </div>
<h2>Panel 1</h2>
This panel starts closed because style='display:none' is defined in
the style section of the head
</div>
<div class="toggle"><a href="javascript:toggleDiv('panel2');" >Toggle
Panel 2</a></div>
<div id="panel2" class="panel" style="display:block;">
<h2>Panel 1</h2>
This panel starts open because of style='display:block'
</div>
<a href="javascript:toggleDiv('panel1');" >Another Link to Toggle Panel
1</a>
[/CODE]
Comment