[jQuery] Re: Modify iframe with jquery

2009-05-15 Thread Kevin Dalman

If you cannot change the scrolling by modifying the iframe, then do it
by modifying the document inside the iframe.

I don't remember the syntax for accessing the document/body elements
inside an iframe, so I'll just use pseudo-code here. You should be
able to find the correct syntax easily...

$(#iframe)[0].document.$(body).css({ overflow: hidden; });

This will work as long as the iframe content is in the same domain as
your parent page. If it is in a different domain, then browser
security will prevent you from accessing the document inside the
iframe.

/Kevin


On May 14, 1:56 pm, ripple ripple...@yahoo.com wrote:
 Thanks, but it's not the contents of the iframe that I'm looking for. It's 
 altering the behavior(scrolling) of the iframe that i am trying to achieve.
  

 --- On Thu, 5/14/09, waseem sabjee waseemsab...@gmail.com wrote:

 From: waseem sabjee waseemsab...@gmail.com
 Subject: [jQuery] Re: Modify iframe with jquery
 To: jquery-en@googlegroups.com
 Date: Thursday, May 14, 2009, 4:48 PM

 $(#iframeid).contents.find(#elementid);
 $(#iframeid).contents.find(#elementid).text();
 $(#iframeid).contents.find(#elementid).html();

 I used this earlier today with some php where a wysiwyg editor had its html 
 contents embedded in a Iframe and i hate to post the raw html to a database. 
 worked like a charm.

 On Thu, May 14, 2009 at 10:43 PM, ripple ripple...@yahoo.com wrote:

 I have an iframe in a page that scrolls on initial load, but after
 clicking a link and loading a different page I have to remove the
 scroll(scrolling=no).

 When the 2nd page loads I set the attr on the the iframe to
 scrolling=no.

 $('#iframe').attr('scrolling','no');

 But, This does not seem to work. Does anyone know? Is the iframe more
 of a static object after initial creation and load? Can it's parameters
 (except for src) not be changed?

 Thanks


[jQuery] Re: Modify iframe with jquery

2009-05-14 Thread waseem sabjee
$(#iframeid).contents.find(#elementid);
$(#iframeid).contents.find(#elementid).text();
$(#iframeid).contents.find(#elementid).html();

I used this earlier today with some php where a wysiwyg editor had its html
contents embedded in a Iframe and i hate to post the raw html to a database.
worked like a charm.

On Thu, May 14, 2009 at 10:43 PM, ripple ripple...@yahoo.com wrote:


 I have an iframe in a page that scrolls on initial load, but after
 clicking a link and loading a different page I have to remove the
 scroll(scrolling=no).

 When the 2nd page loads I set the attr on the the iframe to
 scrolling=no.

 $('#iframe').attr('scrolling','no');

 But, This does not seem to work. Does anyone know? Is the iframe more
 of a static object after initial creation and load? Can it's parameters
 (except for src) not be changed?

 Thanks


[jQuery] Re: Modify iframe with jquery

2009-05-14 Thread ripple
Thanks, but it's not the contents of the iframe that I'm looking for. It's 
altering the behavior(scrolling) of the iframe that i am trying to achieve.
 


--- On Thu, 5/14/09, waseem sabjee waseemsab...@gmail.com wrote:


From: waseem sabjee waseemsab...@gmail.com
Subject: [jQuery] Re: Modify iframe with jquery
To: jquery-en@googlegroups.com
Date: Thursday, May 14, 2009, 4:48 PM


$(#iframeid).contents.find(#elementid);
$(#iframeid).contents.find(#elementid).text();
$(#iframeid).contents.find(#elementid).html();

I used this earlier today with some php where a wysiwyg editor had its html 
contents embedded in a Iframe and i hate to post the raw html to a database. 
worked like a charm.


On Thu, May 14, 2009 at 10:43 PM, ripple ripple...@yahoo.com wrote:


I have an iframe in a page that scrolls on initial load, but after
clicking a link and loading a different page I have to remove the
scroll(scrolling=no).

When the 2nd page loads I set the attr on the the iframe to
scrolling=no.

$('#iframe').attr('scrolling','no');

But, This does not seem to work. Does anyone know? Is the iframe more
of a static object after initial creation and load? Can it's parameters
(except for src) not be changed?

Thanks



  

[jQuery] Re: Modify iframe with jquery

2009-05-14 Thread waseem sabjee
$(#iframeid).contents.find(#elementid).append('div
id=newdiv\/div);

notice i use \/div instead of /div
this is due to the Why JavaScript Handles strings so \/ will actually give
you / sometimes you may need to use // instead

On Thu, May 14, 2009 at 10:56 PM, ripple ripple...@yahoo.com wrote:

 Thanks, but it's not the contents of the iframe that I'm looking for. It's
 altering the behavior(scrolling) of the iframe that i am trying to achieve.



 --- On *Thu, 5/14/09, waseem sabjee waseemsab...@gmail.com* wrote:


 From: waseem sabjee waseemsab...@gmail.com
 Subject: [jQuery] Re: Modify iframe with jquery
 To: jquery-en@googlegroups.com
 Date: Thursday, May 14, 2009, 4:48 PM


 $(#iframeid).contents.find(#elementid);
 $(#iframeid).contents.find(#elementid).text();
 $(#iframeid).contents.find(#elementid).html();

 I used this earlier today with some php where a wysiwyg editor had its html
 contents embedded in a Iframe and i hate to post the raw html to a database.
 worked like a charm.

 On Thu, May 14, 2009 at 10:43 PM, ripple 
 ripple...@yahoo.comhttp://us.mc344.mail.yahoo.com/mc/compose?to=ripple...@yahoo.com
  wrote:


 I have an iframe in a page that scrolls on initial load, but after
 clicking a link and loading a different page I have to remove the
 scroll(scrolling=no).

 When the 2nd page loads I set the attr on the the iframe to
 scrolling=no.

 $('#iframe').attr('scrolling','no');

 But, This does not seem to work. Does anyone know? Is the iframe more
 of a static object after initial creation and load? Can it's parameters
 (except for src) not be changed?

 Thanks