How to Display a replacement banner/bg, ONLY when a visiting user is using an Ad Blocker?

truelux

Regular Member
Joined
Jun 16, 2011
Messages
330
Reaction score
94
I'm not 100% sure how browser plugins, such as Ad Blocker, works but is there a way to still display some type of a picture/css?

Does an ad block make an entire DIV display:none?

I'm trying to think of a way to make a banner that says, "This site relies on ads. Please disable your adblocker or click here to donate to have ads removed"

thanks!
 
Typically they remove the element from the DOM entirely (especially in the case of iframed ads) and often get removed if they're standard dimensions (728x90 etc).


You can just use CSS and apply a background-image rule to the element in question that says what you'd like it to say if the image just doesn't load OR you could check to see if the element exists within the DOM and overwrite whatever attributes you need edited.
 
Back
Top