Column background image with cursor pointer on hover and link to page

Hi,

Trying to have a column/backgroundimage link to a page when user hovers over the whole image.

Gave the column and ID -> #kids

jQuery:

jQuery( document ).ready(function($) {
	$('#kids').on('click touched', function() {
		window.location.href = 'LINK HERE'; });
});

CSS:

#kids  {
	cursor: pointer;
}

But no go :frowning:

Hi Daniel,

Thank you for writing in, I see that you assigned your ID like this #kids



When assigning an ID please do not include the # symbol, you only add that when targeting that ID on CSS or JS.

It seems that there is a JS error going-on on your site, and it seems coming from one of your custom scripts.


Please audit your custom script by removing it one by one and see which one is causing the error.

Please be reminded that we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

Thank you for your understanding.

1 Like

Thanks for the response.
It was the “#”, now image links fine.

Regarding the remaining error, I really don’t have a lot of custom JS script, what I have was checked by the wonderful forum staff. :grin:
Don’t have any plugins other than the ones bundled.

TypeError: $ is not a function

Can you point me in the right direction to find where the error comes from?
I got the background image linking to a page from this thread, and it works. No other JS script on this page

Hi There,

It seems the error is coming from the JS code you have on the Theme Options > JS, try removing those JS and see if the error is gone.

If not, please do a testing for a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Please be reminded that the custom codes we provided are only guidelines, it is users responsibility to update it if needed to be and to edit it to fit on what they needed it to do, like what you did on the JS code I provided on that other thread.

Thank you for understanding.

Hi,

I totally understand.
Some of these coding intricacies are a bit above my pay grade :wink: but the more you do it the more you learn.

Thanks again for the help.

You’re more than welcome, glad we could help.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.