Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jQuery .load disabling anchor, .live having no effect.

Featured Replies

Hey guys,

 

Hopefully some knowledgeable person will be able to help me as I'm stumped.

 

I have a page which is loading content via jQuery's .load. The content loads fine except I've noticed that links don't work. Now I know this is because they are added after the DOM load, but assigning .live to it has no effect. I thought this was what was supposed to be used to add stuff to the DOM after it's loaded, or am I missing something?

 

Also, the link shows as being visited but as I say, is not clickable. (But is selectable, as in highlightable).

 

The jQuery script:

$('.clickme').live('click', function() {

	alert("test");

});

 

 

The link that is being loaded via .load:

<a class="clickme" href="http://www.kanecheshire.com">Some text</a>

 

 

I guess that doesn't really help much, so if you want me to upload the site to my domain for testing out let me know and I will.

 

Thanks for your help.

  • Author

If you can post a link I'll have a look

 

http://midsonbrown.kanecheshire.com

 

Click on "Solutions" then "Coaching" after the sliding thing is finished. The link is at the bottom of that page after it loads.

 

Don't judge me if you come across other bugs, I'm working through them!

#contentwrapper z-index:-1; is why you cant click the link

 

 

 

#mainbannerbgbottom {
   background: url("../images/mainbannerbgbottom.png") no-repeat scroll 0 0 transparent;
   height: 9px;
   position: relative;/*added*/
   width: 906px;
   z-index: 2;/*added*/
}
#contentwrapper {
   background: url("../images/contentbgmid.png") repeat-y scroll 0 0 transparent;
   font-family: Verdana,Geneva,sans-serif;
   height: 0;
   margin: 0 auto;
   overflow: hidden;
   position: relative;
   top: -10px;
   width: 870px;
   z-index: 1;/*changed to 1*/
}

 

Edited added css

Edited by mteam

  • Author

#contentwrapper z-index:-1; is why you cant click the link

 

Amazing. I've clearly been staring at the screen too long today. Any idea how long I've been trying to fix that? :p At least it's all billable dirol.gif

 

Voted your post up mate, thanks again, much appreciated!

 

*sheepishly carries on working*

  • Author

I've added css to my previous post I should have done it to begin with

 

It's cool I got it but it's useful for others (although my problem was a silly mistake)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.