SitePoint Sponsor |
|
User Tag List
Results 26 to 42 of 42
-
Jan 31, 2007, 17:33 #26
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No JavaScript is not compatible with all web browsers, because all web browsers do not support it.
Yes, that script is compatible with IE7.
Edit: I forgot the word "not".Last edited by Kravvitz; Feb 1, 2007 at 04:37.
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Feb 1, 2007, 04:17 #27
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Problem solved.
Many thanks to Kravvitz and the others here, for all of the help given in this thread - it's been very much appreciated.
Dez.
-
Feb 1, 2007, 08:45 #28
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Aaaaargh - spoke too soon ! How would you do it Kravvitz, using your method, if you wanted the user to click on an image to add to their favorites please ?
http://www.010805.com/favorites
Any help much appreciated.
Dez.Last edited by Dez; Feb 1, 2007 at 09:17.
-
Feb 1, 2007, 17:41 #29
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The script would need to be modified to create an image inside the link instead of text.
Why do you want to use a star? People who don't use IE/Win might not realize what it's for.We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Feb 2, 2007, 02:07 #30
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Many thanks for the quick response Kravvitz - it's appreciated.
There might be the text link on one page and the image link on another page, so the script would need to accommodate both really.
Good point about the star - sometimes people notice images more than text, and I think that the star is widely recognised by nearly all users as an add to favorites image.
All the best.
Dez.
-
Feb 6, 2007, 02:57 #31
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Kravvitz,
How did it go with the code for the image please ? Any luck with it ?
All the best.
Dez.
-
Feb 6, 2007, 13:09 #32
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
image link
Having an image instead of text inside a link is relatively common.
Instead of <a ... >text here</a>
it's <a ... ><img ... /></a>
Are you having problems with your version of this mark-up?Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Feb 6, 2007, 14:08 #33
- Join Date
- Dec 2006
- Location
- Prague
- Posts
- 210
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You have there two id, both the same. Id must be unique, that is why the second one link not works as you expected.
-
Feb 6, 2007, 14:30 #34
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Many thanks for the input Mittineague and Mirek, but I don't really know what to do next on this.
In answer to Mittineague, I think, from what Mirek's saying, is that there needs to be another way to identify that a link with the image in it ?
Kravvitz has kindly got me to this point, but just need to get the image part done now.
Any help appreciated.
Dez.
-
Feb 6, 2007, 17:04 #35
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
more than 1 id
Sorry, I didn't check the page's source before. But Mirek is correct, you will have problems trying to use ids that aren't unique.
HTML Code:<li id="addBookmarkContainer"></li> <p> </p> <li id="addBookmarkContainer"> <img border="0" src="index.1.jpg"></li>
HTML Code:<li id="addBookmarkContainer"> <img border="0" src="index.1.jpg"></li>
Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Feb 6, 2007, 17:19 #36
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You expect me to customize it for you for free? *sigh*
It's given me an idea for an improvement.
The link is generated with a JS/DOM script.
Yes, IDs must be unique. Also the script isn't magic. It must be written in such a way that it creates the image inside the link.
That's putting it lightly. You're using my script and I've had to coach you about how to use it.
I've updated the script now.We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
May 1, 2007, 06:20 #37
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just trying to implement what was kindly suggested here (been a bit of delay due to family problems - I guess we all get them!!).
When clicking on that link above, the bookmark link on that page still says press ctrl D to bookmark the page ? I thought we were trying to bookmark by clicking once on the link and then clicking ok, for it to go into your favourites and not into the sidebar ? and without any need for pressing ctr D In fact the same way that IE users do it ?
Any help much appreciated.
Dez.
-
May 1, 2007, 11:55 #38
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, we would like to avoid making the user press CTRL + D. However, the two ways to bring up the Add Bookmark dialog by clicking on a link in Firefox both add a bookmark that opens in the sidebar. You would have to go to the bookmark's properties after you added it to disable that so it would load in a normal window/tab. I expect most users would be unpleasantly surprised and probably confused when the bookmark opened in the sidebar instead of where it normally would.
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
May 9, 2007, 07:03 #39
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Kravvitz,
When you adjusted the code to make sure that it worked for images - is that the new code on your link please ?
I've tried to do it a little - but the bookmark on the image doesn't work ?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Bookmark</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="add_bookmark.js"></script>
<style type="text/css">
body {
background-color: #fff;
font-family: arial, helvetica, verdana, tahoma, sans-serif;
color: #000;
margin: 100pxx;
text-align: center;
padding: 100px;
}
a {
color: #000;
font-weight: normal;
}
a:hover {
background-color: #000;
color: #fff;
text-decoration: none;
}
</style>
</head>
<body>
<p id="addBookmarkContainer"><img border="0" src="index.1.jpg"></p>
</body>
</html>
http://www.010805.com/favorites
The helps appreciated.
Dez.
-
May 9, 2007, 14:16 #40
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The script will generate the <img> when you call the function that creates an image link instead of the one that creates a text link. So remove the <img> from the HTML and in the script change
Code:dss_addEvent(window,'load',addBookmarkObj.addTextLink); // below is an example of how to make an image link with this // the first parameter is the ID. If you pass an empty string it defaults to // 'addBookmarkContainer'. /* dss_addEvent(window,'load',function(){ addBookmarkObj.addImageLink('','/images/add-bookmark.jpg'); }); */
Code://dss_addEvent(window,'load',addBookmarkObj.addTextLink); // below is an example of how to make an image link with this // the first parameter is the ID. If you pass an empty string it defaults to // 'addBookmarkContainer'. dss_addEvent(window,'load',function(){ addBookmarkObj.addImageLink('','index.1.jpg'); });
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jun 14, 2007, 06:13 #41
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Kravvitz,
Bet you thought you'd got rid of me ehApologies for the time in between posts - family issues
I've now done what you kindly suggested above and the text link works great, but is there any way of getting it to do exactly the same thing on the image as well please ?
http://www.010805.com/bookmarks
As usual, the helps always appreciated.
Dez.
-
Jun 15, 2007, 12:04 #42
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm not entirely sure what you're asking.
Try this.
Code:dss_addEvent(window,'load',function(){ addBookmarkObj.addImageLink('','index.1.jpg'); }); dss_addEvent(window,'load',addBookmarkObj.addTextLink);
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
Bookmarks