|
|
How To Thwart Scene Stealers; Changing Cursors; Parsing SHTML FilesBy David Fiedler and Scott Clark Dear Dr. Website®: How can I disable the right-click button on a user's mouse to prevent him from "borrowing" images from my site? Also, how can I change the appearance of my cursor? There is a great explanation of how to do that here: http://javascript.internet.com/page-details/no-right-click.html. It is not absolute protection; Mac users can still grab an image, and anyone can still view the source and grab the image in their browser. As for changing the cursor, you can use style sheets to do it (for MSIE, anyway; we don't think it can be done for Netscape without using plug-ins). The following example would create a crosshair cursor for any images on the page:
<style type=text/css>
<!--
img {cursor: crosshair}
-->
</style>
or you could use these cursors:
cursor: default cursor: n-resize cursor: s-resize cursor: e-resize cursor: w-resize cursor: ne-resize cursor: se-resize cursor: nw-resize cursor: sw-resize cursor: auto cursor: hand cursor: text cursor: wait cursor: helpIf you want to get really fancy with cursor changes, check out CometZone. Dear Dr. Website®: I run a Web site in my spare time and just redesigned the main page. I used SSI polls, so I had to change the extension to .shtml. Many links on subsequent pages point to the original .html page. What can I do to make the old .html page automatically redirect to the new .shtml page? It's not always true that SSI pages must end with the .shtml extension, but don't feel too bad. We see plenty of online manuals from ISPs and Web hosting providers that incorrectly tell you this, even on systems where you can do the following: Assuming you're on a Unix system, try this first, since it often works. Instead of changing the extension to .shtml, just chmod it to make that individual file executable: chmod 755 filename.htmlYou can do this via the shell or from a good FTP program. If that doesn't work, you can edit the .htaccess file (or create one if it doesn't exist) in the main HTML directory to add the following line: AddType text/x-server-parsed-html .htmlThe good news is that this almost always works; the bad news is that now every file ending with .html will be checked for SSI tags when it's served, which slows down your server somewhat. However, if you start using SSI everywhere (for instance, many banner ad packages use SSI), this will make things much nicer than renaming all your files to .shtml. Finally, if you have to leave things as is, then you can add the following code to your .html pages to point them to the correct .shtml page: <SCRIPT LANGUAGE="JavaScript"> <!--// window.location = "correctpage.shtml"; //--> </SCRIPT> Visit The Dr. Website® Archives. Click here for a list of Dr. Website's most frequently asked questions (and answers!). Send your own question to Dr. Website®.
Contact the WebDeveloper.com® staff Last modified: 20
|
Refresh Daily
|