views:

44

answers:

1

Hi I'm struggling in getting the end bit of this jquery correct and I'm not sure if it'd work - want to add to a image filename if the screen is a certain size

here's the code

<script type="text/javascript">

$(document).ready(function() {

if ((screen.width>=1024) && (screen.height>=768)) {

   var re = new RegExp("(.+)_hover\\.(gif|png|jpg)", "g");
   return filename.replace(re, "$1.$2");
}
</script>

Any ideas ? Thanks in advance

A: 

Check into this blog: http://www.bennadel.com/blog/1801-Creating-An-Infinite-Scroll-Effect-With-jQuery-And-ColdFusion.htm

Look at height() and offset() in jQuery.

Good luck (:

Wartickler