SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    trouble combining two javascripts

    the following page

    www.
    phi
    lipdu
    sel.com/work.html

    has two java scripts i set up(pasted) to get it so that i can rotate the main image by clicking sevearl options

    i just couldnt do it with the two javascripts as one....it seems like a lot of unecessary script to just add an already existing function to another element

    thanks
    i hope this is clear enough

  2. #2
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by phillycheese123 View Post
    has two java scripts i set up(pasted) to get it so that i can rotate the main image by clicking sevearl options

    i just couldnt do it with the two javascripts as one....it seems like a lot of unecessary script to just add an already existing function to another element
    I only see one script (below), and it 's not for rotating images, but for resizing?
    And the resize function would give it another .gif src ?
    Code JavaScript:
    	$(document).ready(function() {
     
    		function imageresize() {
    			var contentwidth = $('#content').width();
    			if ((contentwidth) < '700'){
    			    $('.fluidimage').attr('src','mymy1.gif');
    			} else {
    			    $('.fluidimage').attr('src','biggy.gif');
    			}
    		}
     
    		imageresize();	
     
    		$(window).bind("resize", function(){
    			imageresize();
    		});
     
    	});


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •