javascript - Show & Hide Dynamic content -



javascript - Show & Hide Dynamic content -

ok i've got inbox style layout, multiple messages dynamic content each message, want click on link (action needed) , 1 time click open drop downwards div containing iframe. javascript using:

<script language="javascript"> function toggle() { var ele = document.getelementbyid("toggletext"); var text = document.getelementbyid("displaytext"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerhtml = "<iframe src=\"http://m.quotesin.com/an.html\" width=\"100px\" frameborder=\"0\" height=\"20px\" allowtransparency=\"yes\" scrolling=\"no\"></iframe>"; } else { ele.style.display = "block"; text.innerhtml = "<iframe src=\"http://m.quotesin.com/an.html\" width=\"100px\" frameborder=\"0\" height=\"20px\" allowtransparency=\"yes\" scrolling=\"no\"></iframe>"; } } </script>

and display this:

<a id="displaytext" href="javascript:toggle();"><div style="posistion:relative;"><img src="images/iframe.png" style="position:absolute;"><iframe src="http://m.quotesin.com/an.html" width="100px" frameborder="0" height="20px" allowtransparency="yes" scrolling="no"></iframe></div></a>

the images design view here... before: after: when there more 1 of these in inbox sec wont open, there simple css show , hide parent , kid not share same attributes can use, or advice on go this.

thank you

as far dynamic html concerned, can't handle without using javascript or jquery. secondly javascript have written using getelementbyid allows single element( has same id specifed. ) selection. since want have same code work multiple inbox, need have container , kid selector help give same effect. need utilize selector other id allows multiple selection. allow me know if getting wrong.it more improve if can set code in js fiddel.

enjoy coding ;)

javascript html show-hide

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -