Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Background image zooms in when ASP in activated
This topic contains 4 replies, has 2 voices, and was last updated by lunchblocks 7 years, 11 months ago.
- AuthorPosts
- November 3, 2015 at 5:30 pm #6544
Hi,
So this is very strange, but I have been struggling for days now trying to figure out an issue with my website. The background image is fine when you open a page and suddenly it zooms it. Messing up with quality of the image and the overall visual composition.
Finally today I tried to turn all my plugins off to see if one of them was the source of that bug. Ajax pro was the plugin causing that background zoom…
Have you seen that before? Is there a fix?Thank you
Amalia
November 3, 2015 at 6:38 pm #6545And that’s not all, when I turn it off, then i have elements disappearing. On the recipe page for example, all the recipes disappear… So strange.
November 4, 2015 at 8:05 pm #6552Hi!
I’ve just done some testing.
After deactivating the plugin from what I can see there is an error in one of the header scripts, which is most likely causing the whole problem: https://i.imgur.com/aDFlcE4.png
The error states:
Uncaught TypeError: $ is not a function
Which happens if the jQuery object is not mixed into the “$” object. The reason why it worked with the search active is, that the plugin tries to fix this issue. This is definitely not caused by ajax search pro, as a de-activated plugin code has no effect on the site whatsoever – because simply no code is executed from it’s directory.
After looking more into the error message, the following code is giving the error in the site header:
jQuery(document).ready(function(){ $(".wpurp-user-menus-by").before( "<div class='sHeadTxtsidebar'>Your saved meal planners</div>" ); $(".user-menus-input-container").before( "<div class='sHeadTxt'>Your planner name:</div>" ); $(".user-menus-input-container").before( "<div class='sHeadsubTxtNote' >(default is date and username, but you can change it)</div>" ); $(".user-menus-selected-recipes").before( "<div class='sHeadTxt'>Recipes in your grocery list and planner:</div>" ); $(".user-menus-buttons-container").before( "<div class='sHeadsubTxt'>don't forget to adjust the number of servings</div>" ); $(".user-menus-ingredients").before( "<div class='sHeadTxtgrocerylist' style='padding-top:40px;'>your grocery list</div>" ); $(".user-menus-buttons-container button").first().text("SAVE YOUR PLANNING"); $(".user-menus-buttons-container button").last().text("PRINT PLANNER"); })
This code is actually adding elements, menu items into the page. And the problem is that while the function waits for the jQuery document ready event, it then uses the “$” variable as jQuery, which of course is not defined. So I would try to change it to something like:
jQuery(document).ready(function(){ jQuery(".wpurp-user-menus-by").before( "<div class='sHeadTxtsidebar'>Your saved meal planners</div>" ); jQuery(".user-menus-input-container").before( "<div class='sHeadTxt'>Your planner name:</div>" ); jQuery(".user-menus-input-container").before( "<div class='sHeadsubTxtNote' >(default is date and username, but you can change it)</div>" ); jQuery(".user-menus-selected-recipes").before( "<div class='sHeadTxt'>Recipes in your grocery list and planner:</div>" ); jQuery(".user-menus-buttons-container").before( "<div class='sHeadsubTxt'>don't forget to adjust the number of servings</div>" ); jQuery(".user-menus-ingredients").before( "<div class='sHeadTxtgrocerylist' style='padding-top:40px;'>your grocery list</div>" ); jQuery(".user-menus-buttons-container button").first().text("SAVE YOUR PLANNING"); jQuery(".user-menus-buttons-container button").last().text("PRINT PLANNER"); })
Or maybe leave it unchanged and rather move it to the footer.php file in your theme, so it won’t block the page rendering.
This is the only error as far as I can see, but there might be more after fixing this one. I suggest fixing the page with the plugin deactivated to make sure it’s working properly.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 4, 2015 at 8:09 pm #6553And the background zoom is caused by the parallax scrolling script. Because the upper mentioned error stopped further script execution on the page, the parallax was not working when the plugin was deactivated, so no zooming happened.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 4, 2015 at 9:14 pm #6554Thank you so much for looking into that, I really appreciate your time.
- AuthorPosts
You must be logged in to reply to this topic.