Greenguy's Board


Go Back   Greenguy's Board > TGP Discussions
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-02-26, 10:05 AM   #1
swedguy
Vagabond
 
swedguy's Avatar
 
Join Date: Aug 2003
Posts: 2,374
Send a message via ICQ to swedguy
Want to shrink your TGP's?

No, not make them smaller, but at least shrink the file size and make them load faster

I was going through one of my script folders and found a javascript I used when I had TGP's. I was never a fan of having something random in the status bar. So the solution was to have an onmouseover + onfocus on all links, which made the pages HUGE. A regular link would look something like this:

<a href="thumbs.php?pct=85&link=pic3&url=http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php" onMouseover="window.status='http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php'; return true;" onFocus="window.status='http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php'; return true;" onMouseout="window.status=''>

That link is 355 bytes.

Now lets change it to something smaller

<a href="thumbs.php?pct=60&link=pic47&url=http://www.gallerydomain.com/00276197-01-01/pictures/05/index.php" onMouseover="ds(href);return true" onFocus="ds(href);return true" onMouseout="os()">

That link is 193 bytes.

What you need to put between your <head> and </head> is this:

<script>
function ds(msg) {
var surl = msg.match(/url=([^&]*)/, "$1")
status=unescape(surl[1])
}
function os() {
status=''
}
</script>


So if your TGP has 300 links you would save 47kB. That's a lot of load time if you're on a modem
swedguy is offline   Reply With Quote
Old 2005-02-27, 12:35 AM   #2
HarryM
No offence Apu, but when they were handing out religions you must have been out taking a whizz
 
HarryM's Avatar
 
Join Date: Jan 2004
Location: Australia
Posts: 285
Send a message via ICQ to HarryM
hey thanks, I needed something like that
HarryM is offline   Reply With Quote
Old 2005-03-08, 07:02 AM   #3
Joe
The information superhighway showed the average person what some nerd thinks about Star Trek
 
Joe's Avatar
 
Join Date: Mar 2005
Location: California
Posts: 337
Nice tip, thanks!

If you're really anal about bandwidth, you can also use an HTML shrinker (or HTML compressor) that removes all the whitespace.
Joe is offline   Reply With Quote
Old 2005-03-24, 01:05 PM   #4
pcum
Just because I don't care doesn't mean I don't understand!
 
pcum's Avatar
 
Join Date: Nov 2004
Location: Netherlands
Posts: 95
Send a message via ICQ to pcum
Just what I needed thanks man great tip
__________________



Stay in Business with Pcum
pcum is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:36 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc