View Single Post
  #5   Spotlight this post!  
Unread 14-02-2013, 16:40
iLloyd iLloyd is offline
Registered User
AKA: Isiah L.
FRC #0128 (The Botcats)
Team Role: Programmer
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Grandview
Posts: 27
iLloyd is an unknown quantity at this point
Re: Team 128's redesigned website!

I don't know if anyone knows jQuery but I am trying to change the width of ".affix" if the screen resolution is above a certain size. I got the code but it doesn't seem to work. Any help?

Code:
<script>
$(document).ready(function() {

if ((screen.width>=2048) && (screen.height>=1152)) {
alert('Screen size: 1024x768 or larger');
$(".affix").css({"width":"7%"});

}
else {
alert('Screen size: less than 1024x768, 800x600 maybe?');

}
});
</script>
EDIT: Also I added the resize script. Just for giggles I mesured the before and after speed of the media.html page.

Before: 3.30s
After: 0.92s.

Holly smokes! A reduction of 2.38 S. Thanks, synth3tk!

Last edited by iLloyd : 14-02-2013 at 17:04. Reason: Added more details