/    Sign up×
Community /Pin to ProfileBookmark

Disable javascript to specific browser? Using CSS maybe?

Looking for a method if disabling javascript when the user is using an iphone….my rollover javascript is waaay to slow on the unit….if I don’t load it, that is fine because I have a static image ABSOLUTE positioned exactly where it would regularly load the images….

(when you disable javascript in a regular browser it looks great with the single photo)

Anyways…since the iphone doesn’t support HANDHELD CSS media type, I researched this and was told that I could use the following CSS3 trick, which works with iphones reportedly and other browsers are supposed to ignore….

[CODE]<link media=”only screen and (max-device-width: 480px)” href=”iPhone.css” type=”text/css” rel=”stylesheet” />[/CODE]

the ‘only’ is apparently the trick, as other browsers flip-out and ignore the whole string then…

The problem with this, is that my javascript still remains in the page and has nothing to do with CSS (except it’s positioning obviously).

Is there a way using the above code to disable all javascript on the page in that instance?

Thanks for any help everyone!

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @brett007 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...