Hi, I have created the following function below to automatically add _on to the end of the filename. This worked perfectly on localhost but what else could I use apart from slit?
$(function(event) { $(\"img.hover\").hover(function(event) { $(this).attr(\"src\", $(this).attr(\"src\").split(\".\").join(\"_on.\")); // adds -hover to the name of the image }, function(event) { $(this).stop(true,false); // prevents the creation of stacked actions $(this).attr(\"src\", $(this).attr(\"src\").split(\"_on.\").join(\".\")); // removes -hover from the name of the image }); });
You can see the example at http://dev.web2works.co.uk/thefcdeli The social media icon, bottom left is where I am using it.
Also this is a new design, what do you guys think?
It looks like the .js is adding the _on to the image src properly. Interestingly enough, when you manually add it in FireBug, the image loads (although it looks to me like the same exact image). But when you hover, it leaves the area blank... strange...
Where as it is using: http://dev_on.web2works_on.co_on.uk/thefcdeli/image/linkedin_logo_on.png
How could I make this work to just look for the image name after the last / of the src in the image? I am not very good with regular expressions if you can help me out please.
I have created the following function below to automatically add _on to the end of the filename. This worked perfectly on localhost but what else could I use apart from slit?
You can see the example at http://dev.web2works.co.uk/thefcdeli
The social media icon, bottom left is where I am using it.
Also this is a new design, what do you guys think?
It looks like the .js is adding the _on to the image src properly. Interestingly enough, when you manually add it in FireBug, the image loads (although it looks to me like the same exact image). But when you hover, it leaves the area blank... strange...
Let's keep digging.
-Jacob
http://dev.web2works.co.uk/thefcdeli/image/linkedin_logo.png
Where as it is using:
http://dev_on.web2works_on.co_on.uk/thefcdeli/image/linkedin_logo_on.png
How could I make this work to just look for the image name after the last / of the src in the image? I am not very good with regular expressions if you can help me out please.
Thanks
- image.png
- image_on.png