Pre Load Images

Pages: 1, 2
free web hosting

Read Latest Entries..: (Post #12) by BuffaloHELP on Apr 23 2005, 06:41 PM. (Line Breaks Removed)
heavensoundsI do not believe one needs to have preload images. One's browser accesses images, for this discussion sake, when the browser calls for and when the viewer clicks on the link (does this make sense?). But here is a thought:What if one's page contains a tree menu made up with graphics as a background or such? And within that tree menu there are submenus that also require graphi... read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > CONTRIBUTE > The Internet > Web Design

Pre Load Images

Tanvir
I want to preload some images with my page and after searching in google I found this code but it doesn't seem to work. Cany anyone tell me what is wrong?

<script language="JavaScript">
<!--
Image1= new Image()
Image1.src = "Slice3_over.gif"
Image2 = new Image()
Image2.src = "Slice4_over.gif"
Image3 = new Image()
Image3.src = "Slice5_over.gif"
Image3 = new Image()
Image3.src = "Slice6_over.gif"
-->
</script>

Reply

rvovk
I use XHTML and CSS code for preloading some images that are used in layout of my page.

This is HTML code for one image:

<div class="hiddenPic"><img src="images/layout/over.jpg" alt="hidden"/></div>

Whereas images/layout/over.jpg is path to yours image file, div class="hiddenPic" defines DIV class.

And CSS code is this:

.hiddenPic {display:none;}

This CSS rules defines that div class HIDDEN is not displayed on the screen, only is preloaded.

I guess Javascript isn't too good choice in your case, cause some, but this is very few people have Javascript disabled, thats why I must do my Pop-Up image in XHTML/CSS way.

Best regards, Robert.

Reply

webaurores
i think the XHTML/CSS solution is too theoric. i mean, it would work with most of your visitors, but not all of them. because MANY people uses old browsers, which doesn't support whether XHTML or CSS.
and, sometimes, those browsers aren't too old. check it out on Firefox. it won't work; i tried something similar to it some time ago: i put SEO information about a page in the begging of it (so Google gives it more value), but it looked awful in the layout, so i tried to hide that info with a CSS code like rvovk's, and it didn't work with Firefox (it did with IE5).

Reply

rvovk
Check it out on my site, here, and you will see that it works. I tried it IE6 and Firefox.

Reply

Vacant
QUOTE(webaurores @ Mar 21 2005, 01:48 AM)
i think the XHTML/CSS solution is too theoric. i mean, it would work with most of your visitors, but not all of them. because MANY people uses old browsers, which doesn't support whether XHTML or CSS.
and, sometimes, those browsers aren't too old. check it out on Firefox. it won't work; i tried something similar to it some time ago: i put SEO information about a page in the begging of it (so Google gives it more value), but it looked awful in the layout, so i tried to hide that info with a CSS code like rvovk's, and it didn't work with Firefox (it did with IE5).
*



CODE

<img src="blah.jpg" width="1px" height="1px" />


Stick this on the homepage (or whatever, the page before the one you want the preloading done on). This will load the image, but will only display 1px of it (which you can't see). Do this for every image, and in theory it'll act as a preload because it will load the image first.

Its a quick fix, but it works for me....

- Vacant.

 

 

 


Reply

kawasu
hmm... i forgot wat i used to preload images. i think it was a javascript but i really can't remember. anyway, if u ask me i really wouldn't use a preload script. it's alright for dial-up users but nowadays everyone is on broadband. having loading scripts only slows broadband in the end, really not worth implementing them anymore.

in the end it's ur choice, i just think they're a waste of time.

Reply

Vacant
QUOTE(kawasu @ Mar 29 2005, 10:42 AM)
it's alright for dial-up users but nowadays everyone is on broadband.
in the end it's ur choice, i just think they're a waste of time.
*



Everyone, in fact, is NOT on broadband. Places like Japan may be on 12 mb connections but over here in the UK we've only just discovered broadband... and most people don't have it here. You need to think about every user to your site.

However, I think that in most cases the preload is not essential anyway...

Reply

mizako
With Javascript i preload images with:
if (document.images)
{
folderopen= new Image(16,16);
folderopen.src="buttons/node_open.png";
folderclose= new Image(16,16);
folderclose.src="buttons/node_close.png";
textimage = new Image(16,16);
textimage.src="buttons/text.png";
arrowopen = new Image(16,16);
arrowclose = new Image(16,16);
arrowopen.src="buttons/arrow_open.png";
arrowclose.src="buttons/arrow_close.png";
}
Then for example if you want to change the image of an element into your Javascript code you write simply:

foldericon=arrowclose.src

Reply

CrashCore
Mizako, I wouldn't say that's quite so simple. The others that posted before you are much less code. I like rvovk's way the best, and it seems to work on his site for me, and I'm using Firefox (who isn't?). It doesn't work as well on IE (I only have it because my family uses it dry.gif), but my IE has been screwed up for a long time. It doesn't work with custom javascripts anymore, and the css is screwed up a lot of time, and installing SP2 with the new version of IE didn't help at all.

Reply

mizako
QUOTE(CrashCore @ Apr 11 2005, 01:11 AM)
Mizako, I wouldn't say that's quite so simple.  The others that posted before you are much less code. 
*



To preoload just an image takes 5 lines of code. Two images 7. Not that much :-)

Reply

Latest Entries

BuffaloHELP
heavensounds

I do not believe one needs to have preload images. One's browser accesses images, for this discussion sake, when the browser calls for and when the viewer clicks on the link (does this make sense?). But here is a thought:

What if one's page contains a tree menu made up with graphics as a background or such? And within that tree menu there are submenus that also require graphics as a background...etc? When a viewer expands a particular menu tree, it will take a short time to load graphics it needed to show it as one programmed. But in the mean time, the viewer would see that "ugly" X picture until that graphic is fully loaded. So, the conclusion is that it just makes the viewing page a little enjoyable (as I tried to say on my previous post).

However, if one's hosting service has limited bandwidth one might face a problem. By preloading images one is using up bandwidth that perhaps might not have needed by the viewer. And thus, the browser downloads that entire graphics to the viewer’s cache and never gets the chance to be "used."

I have a tree menu style that mimics window's help menu (with closed and open folders, little dotted lines to connect them) and each graphics are 1k. Now it may not be much but, 1kB x 26 categories x 3 graphics per category = 78kB. I have an average unique visitor of 58 a day so that's 78kB x 58 = 4,524kB (4.5MB). That's 31.668MB a week, 126.672MB a month (4 weeks)... it adds up.

So, decide how you want to present your web page and use it discretionally.

Good luck.

Reply

heavensounds
Can someone please explain to me why one would acctualy use PRE LOADING IMAGES...

What is the whole idea??

Is it possible that it would pre load some images which are on lets say music.html and i am currently on the index.html page?? This would be nice because the other page would load when someone is looking the index page and then don't have to wait for the next one to load cos' it would have already beed loaded...

Thx for any help...GREETZ

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Pages: 1, 2
Recent Queries:-
  1. loadimages in java script - 371.57 hr back. (1)
  2. load images on focus - 674.44 hr back. (1)
Similar Topics

Keywords : pre, load, images

  1. Getting Flash Images On A Site
    (1)
  2. Best Way For Role-over Images?
    (2)
    Hi Guys, I'm trying to work out the best way to make this site. This is what I have made so
    far using CSS, divs, and spans: Site: http://www.frusciante.trap17.com/slices/coded.html CSS:
    http://www.frusciante.trap17.com/slices/style.css I found a problem with this attempt when you
    resize the browser window all the images move with it. Any suggestions on how to fix this? So
    basically what i want to be able to do with this is have those buttons light up some how when i roll
    over them. My idea was to have each button on a fairly small image, that way you don....
  3. Hoverbox Image Gallery
    a pretty cool way to present Images on a page (1)
    Hoverbox is an Image Gallery which I found some time ago. The feature I like the most about it is
    the effect of the "on-hover" state which changes the image from a small thumbnail size to a
    "mid-size" image. Essentially, it doubles the size of the picture when your mouse hovers on it. The
    Hoverbox uses CSS for the size change and needs no javascript to perform. In fact, it works the same
    without javascript. And... it apparently works in IE. The CSS method used includes 'hiding'
    the larger image until the 'on-hover' state is reached. As you know, IE&#....
  4. How Can I Make My Site Load And Work Faster
    How can i make my site load and work faster (9)
    i just wanted to know some extra tricks and tips i can use to make my site work great, being fast,
    and work well on all browsers. i think this will also help a lot more people and not just me. so
    lets start a list of things we can do to make our site work better, faster. start your commenting.....
  5. How Can I Make My Site Load And Work Faster?
    (17)
    i just wanted to know some extra tricks and tips i can use to make my site work great, being fast,
    and work well on all browsers. i think this will also help a lot more people and not just me. so
    lets start a list of things we can do to make our site work better, faster. start your commenting.....
  6. Activation Code Images, How?
    need help with activation code images (3)
    hi everbody, I am creating this website for an online game KHAN which is of course hosted by
    Trap17.com. Anyway, it accepts membership since its services includes message board for every member
    and message board for groups that members created and of course personal messages. So here is my
    problem, since it accepts membership it requires applicants to fill up forms which ask their e-mail
    address, I want to know how make an activation code that is an image. Get my point? /smile.gif'
    border='0' style='vertical-align:middle' alt='smile.gif' /> it is basically like her....
  7. Oscommerce Images?
    (4)
    Does anyone know where I can find some really good oscommerce replacement images? The ones that
    come with the program don't fit in with my store. I found a contribution that gets rid of them,
    but I am looking for some cool images to replace them with. I'm also looking for them in pink
    preferrably, but I can always change the color in photoshop. Also, for anyone who wants to know,
    I found a cool program that lets you generate oscommerce buttons to fit the color pallete of your
    store at http://oscommerce-buttons.org/ Well back to the grind. Hopefully my st....
  8. Great Background Images
    Don't miss them! (1)
    Here it is: http://home.arcor.de/stefun132/Hintergrund/ ....
  9. Great Background Images
    Don't miss them! (2)
    Here it is: http://home.arcor.de/stefun132/Hintergrund/ ....
  10. How Do I Embed Scripts Into Images?
    (7)
    I've always wondered but I never really knew how.......
  11. 1000 Free Psd Icon Images
    They are very cool (10)
    Here it is: CODE http://www.stud.uni-hannover.de/~ngthanh/1000_ico/page_01.htm
    http://www.stud.uni-hannover.de/~ngthanh/1000_ico/page_02.htm
    http://www.stud.uni-hannover.de/~ngthanh/1000_ico/page_03.htm
    http://www.stud.uni-hannover.de/~ngthanh/1000_ico/page_04.htm
    http://www.stud.uni-hannover.de/~ngthanh/1000_ico/page_05.htm Carpe diem.....
  12. Cropped Thumnail Images?
    newbie.. (0)
    Is there software that will allow you to crop images when you make a have a lot of pics that's
    different sizes? I only use Frontpage & whenever I auto thumbnail images that are different
    sizes..they come out looking very disorganized. I've seen on some sites where they're able
    to make thumbnails all the same size & the thumbnail is not the entire pic, but rather the central
    focus..for example the thumbnail just shows the head, while the actual picture is a view of the
    entire body.....

    1. Looking for pre, load, images

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for pre, load, images

*MORE FROM TRAP17.COM*
advertisement



Pre Load Images



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE