Link to home
Start Free TrialLog in
Avatar of Alexey Fedorov
Alexey FedorovFlag for Russian Federation

asked on

Suppressing the thick selection-border in Netscape and FireFox

Hi, all!

I have the next problem in Netscape and FireFox browsers. When user clicks by left mouse button over some tags (<object>, <td>...) with pressed CONTROL-key, thick  border appears around. My HTML-page uses left mouse button click with pressed CONTROL and such behavior of Netscape is confuses user.

Who know, how can i turn off this border?  Atleast, for <table>, <tr>, <td> and <object> tags.

Also, i want to make all page elements nonselectable. User should not be able to select text and other elements by mouse. Normal behaviour should be kept only for <input> and <textarea>.

How to cancel selection in Netscape and FireFox browsers? I had cancelled selection and context menu in Internet Explorer, but not in Netscape and FireFox.

In Microsoft Internet Explorer i had done it as:

var isIEBrowser = navigator.appName.indexOf( "Microsoft" ) != -1;

        var b = document.getElementById( "idBody" );
      if( b )
      {
            b.oncontextmenu = cancelContextMenu;
            if( isIEBrowser )
                  b.onselectstart = cancelSelect;
      }

function cancelContextMenu( e )
{
      var ev = new InterEvent( e );
      var name = ev.srcEl.tagName.toLowerCase();
      return name == "input" || name == "textarea";
}
function cancelSelect()
{
       var ev = window.event;

      var name = ev.srcEl.tagName.toLowerCase();
      if( name != "input" && name != "textarea" )
        {
                ev.returnValue = false;
                ev.cancelBubble = true;
            return false;
         }
      else
            return true;
}

Thanks.
Avatar of GrandSchtroumpf
GrandSchtroumpf

Why would you want to change normal browser behaviour?
The ctrl+click is a great feature in firefox, i use it very often.
If you want to protect your text from being copied, then put it inside a PNG or GIF image, that's the only way.
Avatar of Alexey Fedorov

ASKER

A thick rectangle appearing around <td> or <object> is confuse user. In my application <object>/<embed> tags are representing "Macromedia Flash Player" placed inside <td>. I had implemented a drawings viewer based on "Flash Player" which functionality includes ZoomIn, ZoomOut, Pan and some other functions. And, a thick frame caused by "ctrl+left click" is an unexpected and hindering decoration.

It is uncorrelated with design and  functionality.

The ability to select HTML-elements (text, buttons...) in some cases is stiring to "Pan" and to "Zoom by Window" drawings by mouse. Dark blue selection appears as unpredictable and covers "Flash Player" and neighbouring HTML-elements. Looks awfully. In "Internet Explorer" it is already suppressed by me and works fine, but in Netscape and FireFox is not.

I had programmed for "Internet Explorer", but in Netscape and FireFox - i am beginner.  Who can assist to suppress "thick rectangle" caused by "ctrl+left click" and ability to select elements?
Ok, it makes much more sense now with these additional comments.
It seems to be a bug in the flash plugin, i just did the same thing over a java applet, and the ctrl+click is not passed to the browser.
You can send a bug report to Macromedia (or should i say to Adobe...)
Hi, GrandSchtroumpf!

No. It is not a bug. Open "https://www.experts-exchange.com" in Netscape or FireFox, press and hold CONTROL key and try to click "left mouse button" over the HTML-page. You will see, in some places around <table>, <td> tags dark blue thick borders.

Also, i want to notice. Mouse click will be passed to browser if you left-click  over "Flash Player" only in case if "Flash Player" is activated as "Windowless" and "Transparent". In order to reach this, you
<PARAM NAME="WMode" VALUE="transparent">  should insert inside <object> tag.

<OBJECT  id="idFla"  style="border-style: none; " codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
 height="450" width="100%" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  VIEWASTEXT  >
     <PARAM NAME="FlashVars" VALUE="">
     <PARAM NAME="Movie" VALUE="FlashLoader.ashx?swfid=<%#SwfURL%>">
     <PARAM NAME="WMode" VALUE="transparent">
      <PARAM NAME="Play" VALUE="false">
      <PARAM NAME="Loop" VALUE="false">
      <PARAM NAME="Quality" VALUE="High">
      <PARAM NAME="SAlign" VALUE="LT">
      <PARAM NAME="Scale" VALUE="noscale">
      <PARAM NAME="Menu" VALUE="false">
      <PARAM NAME="Base" VALUE="">
      <PARAM NAME="AllowScriptAccess" VALUE="sameDomain">                                                                  
      <PARAM NAME="DeviceFont" VALUE="0">
      <PARAM NAME="EmbedMovie" VALUE="0">
      <PARAM NAME="BGColor" VALUE="FFFFFF">
      <PARAM NAME="SWRemote" VALUE="">
      <PARAM NAME="MovieData" VALUE="">
      <PARAM NAME="SeamlessTabbing" VALUE="1">                                                                                    
      <param name = "SWLIVECONNECT" value = "true" >                                                                                    
      <embed id="idFlaEmb"  name="idFla" Scale = "noscale" src="FlashLoader.ashx?swfid=<%#SwfURL%>" quality="high" bgcolor="#ffffff" height="450" width="100%"  allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  SWLIVECONNECT = "true" MENU="false" WMode = "transparent" SAlign="LT" />
</OBJECT>
ASKER CERTIFIED SOLUTION
Avatar of GrandSchtroumpf
GrandSchtroumpf

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial