473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Hide a div with javascript from an iFrame page

It's possible to hide or show e div from a iFrame page with javascript?
If yes, please can anyone tell me how to do this?

Thanks
Bubu
Nov 3 '06 #1
3 7911
Bubu wrote:
It's possible to hide or show e div from a iFrame page with javascript?
If yes, please can anyone tell me how to do this?
I tried to hide a <blockquotewith "style="visibility:hidden" yet this
just hided the text while the space still was shown as a white area. So
I'm also interested in knowing how to suppress a block.

O. Wyss

--
Cross-platform applications:
http://wyoguide.sf.net/index.php?page=projectlist.php
Nov 5 '06 #2
ASM
Otto Wyss a écrit :
Bubu wrote:
>It's possible to hide or show e div from a iFrame page with javascript?
If yes, please can anyone tell me how to do this?
I tried to hide a <blockquotewith "style="visibility:hidden" yet this
just hided the text while the space still was shown as a white area. So
I'm also interested in knowing how to suppress a block.
From/in your frame :
====================

Javascript in head :
--------------------

function showHide(someThing) {
var elmt = parent.document.getElementById(someThing).style;
elmt.visibility = elmt.visibility==''? 'hidden' : '';
}

function showHideFull(someThing) {
var elmt = parent.document.getElementById(someThing).style;
elmt.display = elmt.display==''? 'none' : '';
}

function deleteElmt(someThing) {
var elmt = parent.document.getElementById(someThing);
elmt.parentNode.removeChild(elmt);
}

function moveElmt(someThing, tarGet) {
var elmt = parent.document.getElementById(someThing);
tarGet = tarGet=='body'? parent.document.body :
parent.document.getElementById(tarGet)
target.appendChild(elmt);
}

HTML (examples) :
-----------------

<a href="#" onclick="showHide('theBlock')">
hide/show main comment
</a>

<a href="#" onclick="showHideFull('theBlock')">
compress/depress main comment
</a>

<button onclick="moveElmt('theBlock','body')">
move main comment to bottom
</button>

<button onclick="moveElmt('theBlock','here')">
move main comment to div 'here'
</button>

<button onclick="deleteElmt('theBlock')">
delete main comment
</button>
HTML in main window :
=====================

<blockquote id="theBlock"blah ...</blockquote>

<div id="here"></div>
Notice :
========

Main page and page in iFrame must come from same domain.
----------------
ask to google : cloneNode
also :
createElement parentNode firstChild hasChildNode setAttribute
appendChild ...
--
ASM
Nov 5 '06 #3
Bubu wrote:
It's possible to hide or show e div from a iFrame page with javascript?
If yes, please can anyone tell me how to do this?

Thanks
Bubu
Thanks
Bubu
Nov 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lee Jong Sung | last post by:
Hi I have to hide my file link, so I use 'iframe'. ( In iframe, use script to insert file link value at parent window's script variable) However It's easy to find the file link value!! (If...
3
by: Ryh | last post by:
I have the following scritpt. It hides div layer when mouse is out of the div layer. Inside DIV I have IFRAME box. Unfortuantely it does not work in Mozilla or IE 5.5. It hides div when cursor is...
5
by: Mel | last post by:
i need to have 2 side by side iframes, a link on top of the one will show/hide the other can someone help me pleeeeezzzzz ?
5
by: Tudor Tihan | last post by:
Hi, This is my first post here, so please be kind. I have tryed to make a javascript html page loader by using an invisible <IFrame> and some javascript variable text passing between...
15
by: Phlip | last post by:
Javascripters: I have an outer page and an inner iframe. The outer page calculates some javascript, and wants the inner frame to run it. The inner frame should hit a page on the same (private)...
5
by: brad | last post by:
I'll post my code below. My goal is to grab the selected text in an iFrame from javascript (really any way possible). When I highlight text in the iFrame and click the link outside of the iFrame, I...
1
by: jadeite100 | last post by:
Hi: I am using IE 6 SP2. My resize attribute does not work <body onresize="test1();">. When I resize my window, the resize event doesnot get call. I have a jsp page with an iFrame called...
1
by: ebrandmark | last post by:
I have an interesting issue in Safari where I have a DIV and inside that DIV I have an IFRAME. If I do a hide or show of the DIV using dv.style.display="none" or dv.style.display="block" with dv...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.