473,657 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7932
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 <blockquotewi th "style="visibil ity: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 <blockquotewi th "style="visibil ity: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(someTh ing) {
var elmt = parent.document .getElementById (someThing).sty le;
elmt.visibility = elmt.visibility ==''? 'hidden' : '';
}

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

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

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

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

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

<a href="#" onclick="showHi deFull('theBloc k')">
compress/depress main comment
</a>

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

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

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

<blockquote id="theBlock"bl ah ...</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
7470
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 someone see the iframe's source) Is there more powerful way for hiding?
3
14433
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 inside IFRAME. NOte that IFRAME is inside DIV so it should not hide DIV. It Works fine in IE6.0. Could any one help? Example:
5
35558
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
2194
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 entities. This seems to brake the CSS after some depth, or perhaps I am not understanding something.
15
2250
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) web server, so this is not a cross-site scripting attack. But I would prefer not to taint the target page with any extra logic to do this. (I will if I must.) The calling page has these elements:
5
7700
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 receive the following error: Firefox FireBug Error uncaught exception: Permission denied to get property HTMLDocument.getSelection IE7 Error
1
3914
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 test1.jsp. The iFrame src points to a page called test2.jsp. It has a resize attribute that calls a javascript function that is located in test1.jsp. In the test2.jsp page, it doesn't recognize the function that is located in test1.jsp page. Is there...
1
1584
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 being the DIV Object itself it reloads the IFRAME and I now end up with the content of the IFRAME twice within the DIV (one under the next). This code works fine in IE 6 and 7, Firefox, Netscape 8/9 and even on Firefox on the Mac. Anyone have...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.