PDA

View Full Version : Bookmark site on rollover button??


edesigner
09-17-2006, 03:49 PM
Hi folks,

I was wondering if the Dreamweaver experts here
would share how to apply a bookmark to a rollover button.

Iīd appreciate very much to hear from you.

Thanks.

Paulo :D

chriskq
09-18-2006, 12:09 AM
hi... im going to assume you mean when a user clicks a button, you want your page to be bookmarked.
heres how to do it:

<head>
<script type="text/javascript">
function addBookmark(title,url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}
</script>
<style type="text/css">
body {
background-color: #887787;
font-family: "Courier New", Courier, mono;
}
</style>
</head>
<body>


<a href="#"
onmousedown="addBookmark('Bookmark title here','http://youpageurlhere.com/')">
Add Bookmark</a> </p>

</body>
</html>



give that a try.

edesigner
09-18-2006, 09:44 AM
Hi Chris,

Thanks for jumping in. I really appreciate it.

However, I couldnīt make this to work.

This is the code I get from the rollover...

<a href="www.sitename.com" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Bookmark','','images/bookmark_tab2.gif',1)">images/bookmark_tab.gif

How would it look after "mixing" your code with the above one?

Please note that I had to insert a URL when Inserting the Rollover Images but Iīm
not sure itīs correct because that seems to imply we want to go there and
we only want to bookmark the site.

Please advise.

If anybody else wants to support me here Iīd appreciate very much
since I need to deliver this job today.

Thank you.

Paulo

domedia
09-18-2006, 12:52 PM
chris is right, add the attribute 'onmousedown' into your anchor tag and it should work, there's no conflicting code there.

*and* make sure you add the javascript in your head area.

<a href="www.sitename.com" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Bookmark','','images/bookmark_tab2.gif',1)">images/bookmark_tab.gif