Buttons Help! Quick Reply :)

  • 1
  • Question
  • Updated 10 years ago
  • Answered
Hi! i have a few questions about buttons. i how do you make a button that closes a window.
Photo of some kool guyz

some kool guyz

  • 57 Posts
  • 1 Reply Like

Posted 10 years ago

  • 1
Photo of jason

jason

  • 13 Posts
  • 5 Reply Likes
Hi

Firstly I am assuming you have opened a new window which you are now wanting to close? If not, remember the code below will close the window you are viewing. So if it is the main site/browser window, this would close.

To do this you drag and drop an html widget onto your page and in the editor you type in one of the following:-

1. If you want the close window to be a link from either some text or an image
<!-- <a href="javascript:window.close();">Close This Window</a> -->(for text link)
<!-- <a href="javascript:window.close();"><img src=resources/uploadedimagefile.jpg" border=0></a> --> (for an image link)

2. <!-- <input type=button value="Close This Window" onClick="javascript:window.close();"> -->(for a standard button)

Please ignore the <!-- --> this is used to stop the code from being interpreted in this post
Photo of some kool guyz

some kool guyz

  • 57 Posts
  • 1 Reply Like
thanks jason, also how do you make a window pop us from a picture link, its one of the pages on my site. how do i do this?
Photo of Emmy

Emmy

  • 5892 Posts
  • 299 Reply Likes
Hello,
Are you wanting to have another page on your site open up when you click on an image?

You can add links to images, here's how:

1. Add the image to your page, using the image widget.
2. Click on 'Properties' on the right-hand sidebar.
3. Click on 'Choose a Link' and make your selection.
4. Click on 'Apply'

To check that your link is working, preview your page and then click on the link.

This is a brief explanation of how to add links, we have written a tutorial that shows the process in more detail. Here is the link: Creating Links.

Please let us know if this doesn't answer your question or if you have any trouble.

Kind Regards,
Emmy
Photo of jason

jason

  • 13 Posts
  • 5 Reply Likes
There is definitely a way to have a link open in a new window, but it means that you need to do a little HTML editing. Here are the steps:

1. Add text using the text widget.
2. Select the text that you want the link and then click "insert link" on the text editing toolbar.
3. Create your link to your chosen URL as normal, click "OK".
4. Then click "HTML" - the last icon on the text editing toolbar.
5. You will see the code that looks like this for your link (I have used the text "Visit Wikipedia to see more information", with the link being on Wikipedia:
Visit Wikipedia to see more information
All you need to do is add in target="blank" as show below:
Visit Wikipedia to see more information
Your link will then open in a new tab or window, depending on what browser your visitor is using.

Please note: current thinking in web usability circles is that links that open in a new window are a bad idea for a number of reasons. See: http://www.sitepoint.com/article/bewa..., for a great article by a leading expert in the field.
Photo of jason

jason

  • 13 Posts
  • 5 Reply Likes
1. Add text using the text widget.
2. Select the text that you want the link and then click "insert link" on the text editing toolbar.
3. Create your link to your chosen URL as normal, click "OK".
4. Then click "HTML" - the last icon on the text editing toolbar.
5. You will see the code that looks like this for your link (I have used the text "Visit Wikipedia to see more information", with the link being on Wikipedia:
Visit <!--<a href="http://www.wikipedia.org">Wikipedia&l...> to see more information
All you need to do is add in target="blank" as show below:
Visit <!--<a href="http://www.wikipedia.org" target="blank">Wikipedia</a>--> to see more information
Your link will then open in a new tab or window, depending on what browser your visitor is using.

Please note: current thinking in web usability circles is that links that open in a new window are a bad idea for a number of reasons. See: http://www.sitepoint.com/article/bewa..., for a great article by a leading expert in the field.