PDA

View Full Version : Iframe content scrolling



navaldesign
11-06-2005, 03:55 PM
Hi everybody,
this is a follow up from anothet thread.
Does anybody know how to scroll the content of an Iframe without the use of scrollbars?

Brad
11-06-2005, 05:27 PM
How can you scroll without scroll bars? Try using the arrows.

navaldesign
11-06-2005, 06:24 PM
Hi Brad,

maybe I didn't make my self clear. What i mean is that scrollbars are quite unaesthetic inside a browserwhich already has at least one side scroll bar. What I was thinking of is if there is a way that by clicking with the mouse inside the iframe you can acctivate the scroll wheel of the mouse for that Iframe, thus being able to scroll without the presenceof scrollbars. Any tip?

VodaHost
11-06-2005, 06:34 PM
No, this is not possible.

navaldesign
11-06-2005, 07:12 PM
No, this is not possible.

Thanks. I just thought of a trick. I create a white (or what other color is needed) rectangle over the scroll bar, so it kind of "masks" the bar itself. So by pointing inside the Iframe, the scroll wheel of the mouse works perfectly. However, once I have done it, I found out that it is not so intuitive for the visitor that he has first to point the mouse inside the Ifame to be able to scroll, first because if the Iframe doesn't have any border, he can't see the frame itself, and, second, he can't always know there is still some content to see - depends on the content itself. So, maybe the presence of the scrollbars is useful. However, try http://www.navaldesign.info/menu_ita2.html and then click on Utili Links > Enti

Thankyou guys. I'll be back with some other questions.

Maddog
11-07-2005, 07:42 AM
Thanks. I just thought of a trick. I create a white (or what other color is needed) rectangle over the scroll bar, so it kind of "masks" the bar itself. So by pointing inside the Iframe, the scroll wheel of the mouse works perfectly. However, once I have done it, I found out that it is not so intuitive for the visitor that he has first to point the mouse inside the Ifame to be able to scroll, first because if the Iframe doesn't have any border, he can't see the frame itself, and, second, he can't always know there is still some content to see - depends on the content itself. So, maybe the presence of the scrollbars is useful. However, try http://www.navaldesign.info/menu_ita2.html and then click on Utili Links > Enti

Thankyou guys. I'll be back with some other questions.

Have a look at my 2 sites, is this what you mean?

navaldesign
11-07-2005, 07:27 PM
Have a look at my 2 sites, is this what you mean?

Kind of, Maddog. I saw your central window (Iframe ) and the scrolling text. What I meant was having such an Iframe and be able to scroll just using the scroll wheel, with no scroll bars visible. Thanks however. Was the scrolling / stopping text created in BluVoda?

jacobfogg
05-10-2007, 12:37 AM
VodaHost >> No, this is not possible.

Have an open mind VodaHost... anything is possiable!!!



//captures the Scroll wheel movement and focuses it on the iframe
//Handle the movement
function handle(delta) {
if (delta <0){
// fire scroll down event (call a function)
scroll('down')
}else{
// fire scroll up event (call a function)
scroll('up')
}
}
//check for event
function wheel(event){
var delta = 0;
if (!event) event = window.event;
if (event.wheelDelta) {
delta = event.wheelDelta/120;
if (window.opera) delta = -delta;
} else if (event.detail) {
delta = -event.detail/3;
}
if (delta)
handle(delta);
}
function scroll(direction){
if(direction=="up"){
var offSet = document.getElementById('testDiv' ).scrollTop - 15;
}else{
var offSet = document.getElementById('testDiv').scrollTop + 15;
}
document.getElementById('testDiv').scrollTop = offSet;
}


// Initialization code.
if (window.addEventListener){window.addEventListener( 'DOMMouseScroll', wheel, false);}
window.onmousewheel = document.onmousewheel = wheel;


I cannot take credit for the above code... though I can't remember where I found it... I use this code to create scrolling div's, virtual select boxes and more... it captures the scroll wheel event and causes it to fire whatever function you would like (or even run code directly) to create a pseudo-scroll effect...