Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to replace img url using jquery on mobile screen

$(window).resize(function(e){
   if($(window).width() < 568) {
   console.log($(window).width());
    $("#crewimage").each(function() {
      $(this).attr("src", "http://s3.amazonaws.com/libapps/customers/1633/images/icon_52143.png");
                });
            } else if ($(window).width() >= 568) {
                $("#crewimage").each(function() {
                $(this).attr("src","https://ithemes.com/wp-content/uploads/2012/07/mobile300.png");
                });                        
    }         
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: call method from parent 
Javascript :: Getting PointerEvent instead of jQuery.Event on ng-click in AngularJS 
Javascript :: angularjs getting Error: [$rootScope:inprog] $digest already in progress when changed from Fetch to $http + $q 
Javascript :: angularjs How to populate ng-style with object of CSS 
Javascript :: Angular Frontend - How do I change a value I got from backend in frontend 
Javascript :: Chrome DevTools - why does variable display in Watch but not under Scope 
Javascript :: inserting new value to an array of object in typescript 
Javascript :: Calculating state happens to late 
Javascript :: Using animateCamera in functional components in react native 
Javascript :: Get the childrens of an element in react native using useRef 
Javascript :: How to check the increase/decrease of letter input in pasting clipboard in jQuery 
Javascript :: fill array with random numbers javascript using arrow function 
Javascript :: JavaScript delete atray item 
Javascript :: Using javascript code in Jade views - if(variable) shows undefined instead of passing 
Javascript :: TypeError: table.fnFilter is not a function 
Javascript :: store api key in environment variable ngular 
Javascript :: assign single value to multiple variables in React js Or javacript 
Javascript :: get value from createReadStream 
Javascript :: select final 2 indexes in JS 
Javascript :: javascript cookies all together 
Javascript :: select next occurrence visual studio 
Javascript :: cannot setState in event handler 
Javascript :: Viewing Your React App On Another Device 
Javascript :: Toggle image onclicking parent 
Javascript :: how to find default or the first server discord.js 
Javascript :: Backbone View Template 
Javascript :: use spread operator in max method javascript 
Javascript :: Backbone Add To Collection 
Javascript :: javascript for backend 
Javascript :: js onclick add table row 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =