Help - Search - Members - Calendar
Full Version: some html help needed
Get Paid Forum - Get Paid Discussion > Webmaster's Corner > General Discussion on Building, Running & Making Money from a Website
wongfatty
Hi all, help appreciated smile.gif

1. How to block right click?

2. How to put a link that when people click it would bring them to certain area of the page?

Thank you.
sandradj
1. It's not a HTML...You need for that javascript!
2. it's called bookmark and goes like this...First you have to bookmark the part of text where you want to go and than make hyperlink from test-which is going to #text of test:

<html>

<head>
<title>New Page 1</title>
</head>

<body>

<p><a href="index.htm#text of test1">test1</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a name="text of test1">text of test1</a></p>

</body>

</html>
save page as index.htm and try it! smile.gif
USAOK
Just for clarification, it is called an anchor, not a bookmark.

As far as disabling the right click, I wouldn't bother. What is the need for it? It just ticks people off, and it is only a half assed attempt at security. Can easliy get around it.
wongfatty
Thanks for both piece of advice.. trying it now.

As for the disabling the right click.. maybe USAOK you are right.. I am thinking too much. My original thinking is to prevent hotlinking of banners from my site, but now ermm will think of it again.

Anyhow still appreciate if anyone can show me the javascript for this matter smile.gif
Ian
Disabling right clicks won't stop people from hot linking... They just go up to the edit menu and click view source. They can also get around it by turning javascript off or by using another browser.

In other words, your grandmother could get around it ;-)

All disabling right clicks does is make the web harder for people to use.

QUOTE(wongfatty @ Feb 19 2005, 09:50 AM)
Thanks for both piece of advice.. trying it now.

As for the disabling the right click.. maybe USAOK you are right.. I am thinking too much.  My original thinking is to prevent hotlinking of banners from my site, but now ermm will think of it again.

Anyhow still appreciate if anyone can show me the javascript for this matter smile.gif
[right][snapback]3254875[/snapback][/right]

sandradj
QUOTE(wongfatty @ Feb 19 2005, 11:50 AM)
Thanks for both piece of advice.. trying it now.

As for the disabling the right click.. maybe USAOK you are right.. I am thinking too much.  My original thinking is to prevent hotlinking of banners from my site, but now ermm will think of it again.

Anyhow still appreciate if anyone can show me the javascript for this matter smile.gif
[right][snapback]3254875[/snapback][/right]




here's your link... Just copy code on page and leave author...



http://www.java-scripts.net/javascripts/No-Right-Click.phtml


cool.gif wink.gif smile.gif
dvd
right click block
CODE

</script>
<script language="JavaScript1.2">
<!--

if (window.Event)
 document.captureEvents(Event.MOUSEUP);

function nocontextmenu()  
{
event.cancelBubble = true
event.returnValue = false;

return false;
}

function norightclick(e)
{
if (window.Event)
{
 if (e.which == 2 || e.which == 3)
  return false;
}
else
 if (event.button == 2 || event.button == 3)
 {
  event.cancelBubble = true
 
  event.returnValue = false;
  return false;
 }

}

document.oncontextmenu = nocontextmenu;  
document.onmousedown = norightclick;
-->
</script>
wongfatty
Thanks for all the help.

Seems like blocking right click is not a good idea, I will take the advice.

Thanks for everyone that provide the codes though, it's good to learn something smile.gif
lalajean
I think right click blocking is great in the event that you have pictures on your site that you do not want anyone taking. I have a friend who sells his photographs online. If everyone could access and take them, why would they need to buy them.

I know it is good depending on what you are using it for.
USAOK
All you have to do is save the page, and you get all the images on the page. It is really simple.

I wish people wouldn't use the right click block. People like me, like to see the properties of images, or url of an image on a page. Not only that, but some people like to use the right click to open links in a new window.

STAY AWAY FROM RIGHT CLICK BLOCKING.

It is a VERY big NO NO when it comes to web design.
lalajean
Why would you need to see the properties of an image or the url or an image on a page. A typical user would have no need to look at any source code or properties.

Aren't the only people who ususally look at those, these people who want to use them for something else?
m3lovesfun
no right click doesnt realy help as it's realy quite simple to obtain ur images.
USAOK
Not necessarily. I check to see the size of an image sometimes. Or if I see a colour I like in someone elses image, I may want to use the image for that.

It is always bad when you try and restrict the user too much. The general consensus in the design world, is that disabling the right click is very bad. There is absolutely no need for it.
gudrunjacobsen
Disabling right click will only stop a total newbie. Most people know one way or anther to get around it. And there are many ways! If you need to keep images online to show samples of your work, but you want people to buy the originals, make sure the online samples are just that.....run them through PSP or PhotiShop and write the word 'sample' on them, thereby making then unattractive for anyone that can't edit the word out (some techniques will make it impossible to edit out the word, while still letting the visitor getting a good idea of how the original looks).

There are other ways of disabling hotlinking. A good way it to use a .htaccess file with a certain code. You can find information about this here:
http://websiteowner.info/tutorials/server/bandwidththeft.asp
lalajean
qudrunjacobsen:

"There are other ways of disabling hotlinking. A good way it to use a .htaccess file with a certain code. You can find information about this here:
http://websiteowner.info/tutorials/server/bandwidththeft.asp "

Ok thank you, I will go to that website and check out the information that you provided and use that instead of the other.
ilikefreebies
how to create an anchor so a link appears to another section before the text you want to lead to add <a name="anchor name">
then when creating the link to it do <a href="anchor name">your link</a>
hitting view ans source shows all links and HTML.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.