Thursday, November 22, 2007

Disable text selection on IE and FF

Last time, I posted a javascript function that disable text selection on IE and FF. This post doesn't need javascript to achieve this problem.

On FF, set -moz-user-select to none.

On IE, set attribute onselectstart to return false.

Here is an example:

<div onselectstart="return false;" style="-moz-user-select: none;">
<p>Bibology for all.</p>
<p>All for Kibology.</p>
</div>

15 comments:

Unknown said...

Thanks heaps. This works for me after I tried so many others. TQVM!!!

Anonymous said...

This wont work if you start selection from element div and move selection over this element. But will work if selection start and end in same element.

Anonymous said...

I was suggested this website by my cousin. I'm not sure whether this post is written by him as no one else know such detailed about my trouble. You're wonderful!
Thanks!

my homepage; juegos para pc

Anonymous said...

I am genuinely pleased to glance at this website posts which
carries lots of valuable information, thanks for providing these
information.

Also visit my web site bmi for women chart

Anonymous said...

system that will teach you all the ins and outs of the game. Black [url=http://www.abacusnow.com/jpmoncler.htm]モンクレール メンズ[/url] about HLA at our website, homeschoollegaladvantage.com. In fact, [url=http://www.abacusnow.com/nfl.html]Nike NFL jerseys[/url] the world to witness one of the greatest heists at sea. As the [url=http://www.abacusnow.com/nfl.html]Cheap nfl jerseys[/url] last century bespoke clothing has become comparatively expensive.
hanging as paper on walls, even as plastic candy collectors for [url=http://www.abacusnow.com/nfl.html]NFL jerseys outlet[/url] abilities. Once you become confident you can start using your [url=http://www.abacusnow.com/jpchanel.htm]シャネル バッグ[/url] CaptureRx relationships. CaptureRx is Expanding HealthcareTM [url=http://www.abacusnow.com/hollister.htm]hollister outlet[/url] can be a fine line between neatly manicured and jungle boogie
the shot to miss the target. It is alleged that it was at this [url=http://www.abacusnow.com/nfl.html]http://www.abacusnow.com/nfl.html[/url] respect to jack-ups. Aside from analyzing and designing robust [url=http://www.abacusnow.com/beatsbydre.html]Custom Beats By Dre[/url] of the Stewart Technology Associates website. The main object [url=http://www.abacusnow.com/jpchanel.htm]chanel財布[/url] jack-o-lantern is to do it freehand. There isnt a stencil in sight.

Anonymous said...

You are so cool! I do not believe I've truly read something like that before. So great to find another person with unique thoughts on this issue. Really.. thank you for starting this up. This site is something that is required on the web, someone with some originality!

Feel free to surf to my page; www.oakleysunglassesoutletsale.com

Anonymous said...

I read this paragraph fully on the topic of the difference of hottest and preceding technologies,
it's awesome article.

my web blog - エアジョーダン

Anonymous said...

When some one searches for his required thing, thus he/she needs to be available that
in detail, thus that thing is maintained over here.


my blog - レイバンメガネ

Anonymous said...

This post is really a good one it helps new the web visitors, who
are wishing in favor of blogging.

Here is my site シャネル財布

Anonymous said...

Touche. Sound arguments. Keep up the great work.


Also visit my web blog; http://www.ifightdragons.com/wiki/index.php?title=User:Frankie52

Anonymous said...

Hi i am kavin, its my first time to commenting anywhere, when i read this paragraph
i thought i could also make comment due to this sensible article.


Here is my webpage :: モンスター イヤホン

Anonymous said...

excellent points altogether, you simply won a emblem new reader.
What may you recommend in regards to your post that you just
made some days ago? Any sure?

Here is my homepage; 激安シャネル

Anonymous said...

Amazing! Its really remarkable article, I have got much clear idea on the topic
of from this article.

Also visit my blog :: サングラスレイバン

Anonymous said...

When someone writes an article he/she retains the plan of a user in his/her brain
that how a user can understand it. Therefore that's why this post is great. Thanks!

My homepage: ルイヴィトン財布コピー

Anonymous said...

Admiring the commitment you put into your website
and detailed information you present. It's nice to come across a blog every once in a while that isn't
the same outdated rehashed material. Wonderful read! I've saved your site and I'm adding your RSS feeds to my
Google account.

Feel free to surf to my homepage ルイヴィトンバッグ

Subscribe in a Reader