Can't use mouse scroll wheel in iframe
03-22-2008, 02:29 AM
|
Can't use mouse scroll wheel in iframe
|
Posts: 174
Name: A
Location: San Jose, CA
|
On my site, www.icdmeister.com/site/, the main content window (which is in an iframe) was created to have a vertical scrollbar. All works properly with the scrolling but I can't scroll up or down using a mouse's scroll wheel. This is annoying when one's used to using the scroll wheel when browsing.
I'm wondering if there might be a quick fix for this that anyone can recommend.
Andrew
P.S. I know the code's not validated and it's pretty rough. I'm hoping for a suggestion more specific than "clean up your code" even if that may be in order as well.  A.
|
|
|
|
03-22-2008, 08:58 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 69
Name: Rafael Schimassek
|
Well, I looked at it and my Mouse Wheel works with it.
I'm using Firefox.
Don't forget that for example on Firefox you have to hover the iframe with the cursor to be able to scroll it. I'm not sure about it but maybe in IE you have to click inside the frame first.
Schimassek...
|
|
|
|
03-22-2008, 09:37 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 174
Name: A
Location: San Jose, CA
|
Thanks for the input. I hadn't tested this in FF. It works fine for me in FF too. In IE6 and IE7, even clicking inside the iframe doesn't let me use the mouse's scroll wheel. I wonder what's going on.
A.
|
|
|
|
03-23-2008, 12:12 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 5,950
Location: Tennessee
|
Why are you using and iFrame at all ? It's generally NOT a good idea.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
|
|
|
|
03-23-2008, 10:19 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 174
Name: A
Location: San Jose, CA
|
I'm using iframes because I wanted a standard presentation for my ebook content with the header, left nav menu, & footer the same on each of the 2800 or so pages. I thought putting the dynamic content into an iframe would make it load very quickly since the heavy graphics in the border/frame would only need to be loaded once.
Are there CSS alternatives (or other better alternatives) that achieve the same objective?
Andrew
|
|
|
|
03-24-2008, 05:46 AM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 11,461
Location: Blackpool. UK
|
Quote:
|
Are there CSS alternatives (or other better alternatives) that achieve the same objective
|
Absolutely!
Use server side includes (SSI) or scripted include with ASP, .NET, PHP, etc for building the pages.
define images as backgrounds to elements where possible. This way they are defined once then loaded & cached on the first access.
Optimise your images for quick loading. This should be done regardless of how the pages are set up.
Images referenced in <img> elements should be given size attributes, this allows the rendering engine to assign the correct amount space in the document flow as the element is being loaded. Rather than having to wait for it being cached to determine the correct size.
Also iframes suffer the same problems as frames do for SERP clickthroughs, as the page inside the iframe will be indexed as an "orphaned page" without the parent navigation, so the visitor ends up "in limbo" with either "back" or "close" as their next course of action.
See -> This SERP for an example ( it's the "Untitled" result )
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
|
|
|
|
03-25-2008, 12:06 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 174
Name: A
Location: San Jose, CA
|
Chris,
Excellent info. Thanks for taking the time to share it. As a novice website creator, the range of my known possibilities is limited. I mean a couple months ago it was all HTML and tables. Then I got introduced to CSS and have started learning about that. I hadn't even conceived of the possibility of generating my content using server side includes or PHP to basically serve the function of a template. Wonderful! Info like this is one of the things that has made my participation in this forum so valuable. Of course, scripts and SSI sound a bit intimidating to dive into but I'm going to start reading about this and may take a stab at re-doing my site with this technology.
In the short term, I'll take your advice about defining the img size attributes and may also look at some of the options to make sure the iframe content always loads in its appropriate frame (even if linked to directly from a SERP).
Great advice. Thanks.
Andrew
|
|
|
|
03-25-2008, 02:11 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 174
Name: A
Location: San Jose, CA
|
At first read, includes look very easy to use. I just read this article: http://httpd.apache.org/docs/1.3/how...standardfooter
Question: So if I have a page in CSS with a div for my footer, I just replace all of the content of that div with a SSI command? such as
<!--#include virtual="/footer.html" -->
And then I make a separate html file with the footer's contents? It sounds almost too easy.
Can you point me to a site or two that uses this so I can take a look at the source code?
Andrew
Last edited by aschecht : 03-25-2008 at 02:11 PM.
Reason: typo
|
|
|
|
03-25-2008, 03:28 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 11,461
Location: Blackpool. UK
|
Quote:
|
Can you point me to a site or two that uses this so I can take a look at the source code?
|
Look at the linked page in the post above yours  25 includes make up that page (including the scripts files that drive the backend).
This page you are reading and posting to, takes 20+ included files.
The point being is that you can't tell from the source where each include starts and ends, the inclusion is handled before the page source is sent out to the requesting user agents. It simply becomes a monolithic entity.
Quote:
|
And then I make a separate html file with the footer's contents? It sounds almost too easy.
|
It is that easy 
the include file is simply the HTML needed to make up that section, and unlike a frame should NOT be a fully formed document.
When you then need to update or "skin" the site, simply replace the templates that make up the various sections leaving the rest of the site untouched
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
|
|
|
|
03-25-2008, 11:40 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 174
Name: A
Location: San Jose, CA
|
This is very interesting. So the included HTML file shouldn't be a fully formed document. Does this mean no doctype, html, head, title, or body tags - just the content itself?
Does CSS of the parent HTML document apply to all the HTML pulled in by the include?
Andrew
|
|
|
|
03-26-2008, 02:29 AM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 11,461
Location: Blackpool. UK
|
Quote:
Does this mean no doctype, html, head, title, or body tags - just the content itself?
Does CSS of the parent HTML document apply to all the HTML pulled in by the include?
|
Yes and yes
Because there is no "parent" page, every thing is in the one page, just as if you had coded every page individually.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
|
|
|
|
03-26-2008, 01:42 PM
|
Baby steps into SSI
|
Posts: 174
Name: A
Location: San Jose, CA
|
Wow. That WAS easy!
I started with my page www.icdmeister.com/test/
and re-did it using SSI's for the header, the left nav bar, the footer, and the tool icons over the main content area.
Here's the page with SSI: www.icdmeister.com/ssitest/
It cut the total number of lines in my HTML file from 101 to 43 - Sweet simplicity! I think I like this.
(Note: best viewed in FF right now, I'm still trying to work out the unwanted space in the leftnav menu in IE - but that's another thread)
Question about .htaccess file for this:
I put an .htaccess file in the directory with this content: Options +Includes
XBitHack on
then I manually set the permission of the index.html file to 777 using my FTP program. If I'm going to get rid of my iframes I'll need to be applying this to a few thousand files that have .htm extensions. Should I just set the folders containing all of these files to 777 permission or does this raise security concerns? They're all just text/html files.
I tried to use chmod +x *.html in my .htaccess file but this didn't work.
I'm really thrilled to be learning about this very powerful tool.
Andrew
|
|
|
|
04-13-2008, 10:37 PM
|
SSI replaced frames - one small problem
|
Posts: 174
Name: A
Location: San Jose, CA
|
Thanks to the encouragement and guidance of the fine people of this forum, I got rid of my iframe and replaced it with server side includes. I love it! I also got rid of a table is was using for formatting and replaced it with an inline list.
I'm left with one small formatting issue that I've not been able to figure out. I suspect it's probably more of a CSS question but I thought I'd continue on this thread since it's where I started with this.
Here's the site: www.icdmeister.com/demo/
In FF, it looks just as I want it too - the content fills the page, no scroll bar. In IE7, it's messed up - right sided scroll bar and too much vertical space between "rows"
If change the margin-top value, I can make it look right in IE7 but then it messes it up in FF.
What can I do to best fix this?
Andrew
|
|
|
|
04-29-2008, 06:38 PM
|
Limitations of Server Side Includes
|
Posts: 174
Name: A
Location: San Jose, CA
|
So I've successfully eliminated iframes, using SSI in its place. So much cleaner!
A question about SSI - I was looking at my webpages and am seeing a lot of consistent <head> content on every page. Can I use SSI to include all of the content in my header (ie. css stylesheet links, javascript functions, etc)?
If this is possible, what can't be pulled in with SSI? For example, I'm assuming the Doctype and <HTML> tag need to stay in the document itself. Anything else?
If anyone who knows something about SSI can comment on whether including <head> content in an SSI is a good or bad idea, I'd appreciate it.
Thanks,
Andrew
|
|
|
|
04-29-2008, 08:31 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 11,461
Location: Blackpool. UK
|
Quote:
|
Can I use SSI to include all of the content in my header (ie. css stylesheet links, javascript functions, etc)
|
Yes.
Quote:
|
If this is possible, what can't be pulled in with SSI?
|
Absolutely nothing.
Quote:
|
For example, I'm assuming the Doctype and <HTML> tag need to stay in the document itself.
|
Nope every single line of code, text, CSS, javascript etc could be in individual includes.
There isn't an actual "document", each include is a constituent part of the final source code.
The template system for the CMS I'm just finishing off has 15 includes just for the <head> section, as each individual item for the document head can be user controlled from a database configuration.
In most cases the "document" referenced by the URI does not exist as a physical entity.
It is a collection of source code fragments and a couple of hundred thousand lines of code all pulled together and streamed out as binary code to a user agent that can turn it into a viewable "document". Even some of the standard HTML code doesn't exist in the fragments! I have a markup language inside the markup, similar to the way BBCode works, so the doctype looks like [dtd="H401"] or [dtd="X10"], and the script knows how to replace that markup with a full doctype.
When you get into the world of SSI and scripting you have to put away the idea of an actual "page" that exists on a server hard drive and get used to the idea that the "document", as an entity, probably only exists when a user agent requests it.
It's a virtual page for a virtual world.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
|
|
|
|
04-29-2008, 10:59 PM
|
Re: Can't use mouse scroll wheel in iframe
|
Posts: 174
Name: A
Location: San Jose, CA
|
Truly awesome. I can't wait to strip my pages down to their unique, bare essentials using includes. This is very cool stuff.
Thanks for taking the time to nudge me along.
Andrew
|
|
|
|
|
« Reply to Can't use mouse scroll wheel in iframe
|
|
|
|