SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 42 of 42
  1. #26
    CSS & JS/DOM Adept bronze trophy
    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.

  2. #27
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    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.

  3. #28
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    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.

  4. #29
    CSS & JS/DOM Adept bronze trophy
    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.

  5. #30
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    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.

  6. #31
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    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.

  7. #32
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,234
    Mentioned
    194 Post(s)
    Tagged
    2 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?

  8. #33
    SitePoint Addict Mirek Komárek's Avatar
    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.

  9. #34
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    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.

  10. #35
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,234
    Mentioned
    194 Post(s)
    Tagged
    2 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>&nbsp;</p>
    <li id="addBookmarkContainer"> <img border="0" src="index.1.jpg"></li>
    Does it produce suitable results if you try
    HTML Code:
    <li id="addBookmarkContainer"> <img border="0" src="index.1.jpg"></li>
    instead?

  11. #36
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dez View Post
    Hi Kravvitz,

    How did it go with the code for the image please ? Any luck with it ?
    You expect me to customize it for you for free? *sigh*

    It's given me an idea for an improvement.

    Quote Originally Posted by Mittineague View Post
    Having an image instead of text inside a link is relatively common.
    ...
    Are you having problems with your version of this mark-up?
    The link is generated with a JS/DOM script.

    Quote Originally Posted by Mirek Kom&#225;rek View Post
    You have there two id, both the same. Id must be unique, that is why the second one link not works as you expected.
    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.

    Quote Originally Posted by Dez View Post
    Kravvitz has kindly got me to this point, but just need to get the image part done now.
    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.

  12. #37
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz View Post
    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.

  13. #38
    CSS & JS/DOM Adept bronze trophy
    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.

  14. #39
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    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.

  15. #40
    CSS & JS/DOM Adept bronze trophy
    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');
    });
    */
    to
    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');
    });
    P.S. You should use CSS instead of the deprecated border attribute.
    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.

  16. #41
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Kravvitz,

    Bet you thought you'd got rid of me eh Apologies 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.

  17. #42
    CSS & JS/DOM Adept bronze trophy
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •