Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get simple jquery image function
#1
I need help from anyone please.
I have been trying to integrate this jquery function into my get-simple powered website without result.
It is a mouse over function for all .png which also has over.png.I do not know how to use get-simple to link this image over function in jquery.
See the jquery code below:
Code:
.mouseover(function() {
            var src = $(this).attr("src").match(/[^\.]+/) + "Over.png";
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("Over", "");
            $(this).attr("src", src);
        });
I have tried using <?php get_theme_url(); ?>/ to link it for get-simple but it is not working and if i leave it untouched-the mouse over function does not display the image at all.
Please help
Reply
#2
Can anyone please help?
Reply
#3
do you have a test site where we can see the code in action, or not in this case.....
My Github Repos: Github
Website: DigiMute
Reply
#4
Yes .Please check out
Quote:http://valentinaschool.org/valentinamontessori/
You will see all the images breaking with the touch of the cursor.In other words,it cannot display the other images when overed.
This was not so when it was not in Get simple.
Reply
#5
Hi abayomi,

abayomi222 Wrote:This was not so when it was not in Get simple.
The problem is, that the images have absolute URLs now. E.g. the image left to "Special Focus" points to http://valentinaschool.org/valentinamont...erials.png. The mouseover JS posted above will change that to http://valentinaschoolOver.png instead of http://valentinaschool.org/valentinamont...lsOver.png.

So either you have to insert relative image URLs, or you have to change the JS (the latter might be better anyway). Please try:
Code:
.mouseover(function() {
    var src = $(this).attr("src");
    src = src.substr(0, src.lastIndexOf('.'))  + "Over.png";
    $(this).attr("src", src);
})
I haven't tested it, but it should work.

Christoph
Reply
#6
Thank you Chritoph.
It worked perfect.
Reply




Users browsing this thread: 1 Guest(s)