PDA

View Full Version : Scrollable IFRAME and "Wordpress"



wcarcass
01-04-2011, 04:21 AM
1) Script Title: Scrollable IFRAME

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/iframescroll.htm#

3) Describe problem:

Scrollable IFRAME is a very helpful an amazing script BUT How do I enable it to work with "Wordpress content"?

I have an IFRAME which is calling a wordpress page. I do not want to use the default scroll bars so I want to use the Scrollable IFRAME script, but! the second step of it require to append this to the end of the HTML page loaded into the IFRAME:


<!--DO NOT REMOVE BELOW SCRIPT. IT SHOULD ALWAYS APPEAR AT THE VERY END OF YOUR CONTENT-->

<script language="JavaScript1.2">

//Scrollable content III- By http://www.dynamicdrive.com

var speed, currentpos=curpos1=0,alt=1,curpos2=-1

function initialize(){
if (window.parent.scrollspeed!=0){
speed=window.parent.scrollspeed
scrollwindow()
}
}

function scrollwindow(){
temp=(document.all)? document.body.scrollTop : window.pageYOffset
alt=(alt==0)? 1 : 0
if (alt==0)
curpos1=temp
else
curpos2=temp

window.scrollBy(0,speed)
}

setInterval("initialize()",10)

</script>

The problem is that Wordpress pages heavily use PHP and CSS so I dunno if it's even possible to append the script somewhere or if there is a different method... or perhaps simply impossible.

Hope someone can help me.

wcarcass
01-06-2011, 12:20 AM
It's working!!!

Thanks to Miroslav Zografski from Adobe Forum who suggested to copy the JavaScript (second step of the scrollable iFrame) code directly into the Theme's footer.php right before the </body>.

It works like charm... although I haven't test it in IE because I do not have it, but Safari, Firefox, Opera, and Chrome work perfect.