mardi 12 septembre 2017

How to link public directory in external Js file

In my front end side I can show my public directory through "asset." Here when a user hover on the image it should show other image what I have shown through external JS file. But in external Js file I can't indicate public directory through Asset. How do I do that?

  <a href="http://ift.tt/g8FRpY" target="_blank">
                <img id="facebook-icon" src="">
    </a>

// External Js file

$(document).ready(function(){
   $('#facebook-icon').hover(function(){
            $(this).attr('src','images/icon/facebook-hover-icon.svg');
            }, function(){
            $(this).attr('src','images/icon/facebook-icon.svg');
        });
     });



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire