Play a sound when clicking a hyperlink?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Ianson

    Play a sound when clicking a hyperlink?

    Hi, is there a way to play a small sound snippet when a user clicks a
    certain hyperlink hotspot on an image?

    Thanks in advance.


  • dorayme

    #2
    Re: Play a sound when clicking a hyperlink?

    In article <w3HSf.37636$wl .4880@text.news .blueyonder.co. uk>,
    "Chris Ianson" <notme@hotmail. com> wrote:
    [color=blue]
    > Hi, is there a way to play a small sound snippet when a user clicks a
    > certain hyperlink hotspot on an image?
    >
    > Thanks in advance.[/color]

    You mean like the first long chord from a Jimi Hendrix's Star
    Spangle maybe?

    --
    dorayme

    Comment

    • Neredbojias

      #3
      Re: Play a sound when clicking a hyperlink?

      With neither quill nor qualm, Chris Ianson quothed:
      [color=blue]
      > Hi, is there a way to play a small sound snippet when a user clicks a
      > certain hyperlink hotspot on an image?[/color]

      Image Map and Object, but will the visitor hear it if he/she browses
      with sound off as I suspect many do?

      --
      Neredbojias
      Contrary to popular belief, it is believable.

      Comment

      • Randy Webb

        #4
        Re: Play a sound when clicking a hyperlink?

        Chris Ianson said the following on 3/17/2006 5:51 PM:[color=blue]
        > Hi, is there a way to play a small sound snippet when a user clicks a
        > certain hyperlink hotspot on an image?[/color]

        My browser makes a clicking noise already when I click links. It's the
        way *I* want it - not you.

        But, trying to play a sound on a PC without speakers should be an
        entertaining project.

        The answer is no. Well, not in the groups you posted to anyway.

        --
        Randy
        comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
        Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

        Comment

        • dorayme

          #5
          Re: Play a sound when clicking a hyperlink?

          In article <MPG.1e850891c0 143b98989820@ne ws.isp.com>,
          Neredbojias <invalid@neredb ojias.com> wrote:
          [color=blue]
          > will the visitor hear it if he/she browses
          > with sound off[/color]

          If it is _very_ loud, of course, he/she will....

          --
          dorayme

          Comment

          • Neredbojias

            #6
            Re: Play a sound when clicking a hyperlink?

            With neither quill nor qualm, dorayme quothed:
            [color=blue]
            > In article <MPG.1e850891c0 143b98989820@ne ws.isp.com>,
            > Neredbojias <invalid@neredb ojias.com> wrote:
            >[color=green]
            > > will the visitor hear it if he/she browses
            > > with sound off[/color]
            >
            > If it is _very_ loud, of course, he/she will....[/color]

            If it is very loud, it has to occur. Since it can't occur, it can't be
            loud. My opinion of Martian intelligence has plummeted lately.

            --
            Neredbojias
            Contrary to popular belief, it is believable.

            Comment

            • Chris Ianson

              #7
              Re: Play a sound when clicking a hyperlink?

              "Sid Ismail" <elsid@nospam.c o.za> wrote in message
              news:gsun12h6s5 29etgc6kseea8rv jpd69vjtr@4ax.c om...
              [color=blue]
              > I also don't like it.
              >
              > Search Google for "playing sound while surfing".[/color]

              Perhaps you can all help me add a 'sounds on/off' button to my page then
              also. :)

              What I'd like is a constant looping background MP3 (it will just be quiet
              'street noise'), and a specific sound when they click any hyperlink, but
              that option to turn sounds on/off.

              Anyone here got the know-how?

              Thanks in advance.


              Comment

              • dorayme

                #8
                Re: Play a sound when clicking a hyperlink?

                In article <MPG.1e857e6ed3 e93b02989822@ne ws.isp.com>,
                Neredbojias <invalid@neredb ojias.com> wrote:
                [color=blue]
                > With neither quill nor qualm, dorayme quothed:
                >[color=green]
                > > In article <MPG.1e850891c0 143b98989820@ne ws.isp.com>,
                > > Neredbojias <invalid@neredb ojias.com> wrote:
                > >[color=darkred]
                > > > will the visitor hear it if he/she browses
                > > > with sound off[/color]
                > >
                > > If it is _very_ loud, of course, he/she will....[/color]
                >
                > If it is very loud, it has to occur. Since it can't occur, it can't be
                > loud. My opinion of Martian intelligence has plummeted lately.[/color]

                Boji, you have been badly affected by being in BdeZ's killfile.
                Try to imagine a sound that is so loud that it breaks all logical
                barriers and just roll about the floor in paroxysms of laughter
                at this instead of casting aspersions on Martian intelligence.

                Look, I know it will be bad when you meet Officer Bud White. I
                know it is troubling you. But it will not be the end of the world
                and you will emerge a better and stronger man.

                And, btw, don't stir up that "mad hatter" crowd, a few of their
                threads have (after a long absence) started appearing, complete
                with foul language, on my newsreader.

                --
                dorayme

                Comment

                • Neredbojias

                  #9
                  Re: Play a sound when clicking a hyperlink?

                  With neither quill nor qualm, dorayme quothed:
                  [color=blue]
                  > In article <MPG.1e857e6ed3 e93b02989822@ne ws.isp.com>,
                  > Neredbojias <invalid@neredb ojias.com> wrote:
                  >[color=green]
                  > > With neither quill nor qualm, dorayme quothed:
                  > >[color=darkred]
                  > > > In article <MPG.1e850891c0 143b98989820@ne ws.isp.com>,
                  > > > Neredbojias <invalid@neredb ojias.com> wrote:
                  > > >
                  > > > > will the visitor hear it if he/she browses
                  > > > > with sound off
                  > > >
                  > > > If it is _very_ loud, of course, he/she will....[/color]
                  > >
                  > > If it is very loud, it has to occur. Since it can't occur, it can't be
                  > > loud. My opinion of Martian intelligence has plummeted lately.[/color]
                  >
                  > Boji, you have been badly affected by being in BdeZ's killfile.
                  > Try to imagine a sound that is so loud that it breaks all logical
                  > barriers and just roll about the floor in paroxysms of laughter
                  > at this instead of casting aspersions on Martian intelligence.[/color]

                  BdeZ's killfile is like the Devil's Island of the Information Highway.
                  You can't imagine the depths of depravity and insouciance suffered by
                  denizens of that digital deep. Oh...what am I talking about? You're
                  there, too. That explains it.
                  [color=blue]
                  > Look, I know it will be bad when you meet Officer Bud White. I
                  > know it is troubling you. But it will not be the end of the world
                  > and you will emerge a better and stronger man.
                  >
                  > And, btw, don't stir up that "mad hatter" crowd, a few of their
                  > threads have (after a long absence) started appearing, complete
                  > with foul language, on my newsreader.[/color]

                  I don't view them as a crowd, I view each as an individual with a unique
                  persona and responsible for his/her own commentary just as anyone would
                  be. Casually categorizing people into groups leads to discrimination
                  which I have found that Australians in particular are far from free of.

                  --
                  Neredbojias
                  Contrary to popular belief, it is believable.

                  Comment

                  • Jacob.Lyles@gmail.com

                    #10
                    Re: Play a sound when clicking a hyperlink?

                    Hello,

                    I don't know what I'm talking about, but might wrapping some text with
                    nested links work, one for the web page and one for the sound? Lacking
                    that, you could use a Javascript onClick() event handler to redirect
                    them after clicking the link, but you'd be dependent on them having
                    Jscript turned on (which 95% of people do anyway).

                    Comment

                    • Jonathan N. Little

                      #11
                      Re: Play a sound when clicking a hyperlink?

                      Jacob.Lyles@gma il.com wrote:
                      [color=blue]
                      > Hello,
                      >
                      > I don't know what I'm talking about, but might wrapping some text with
                      > nested links work, one for the web page and one for the sound? Lacking
                      > that, you could use a Javascript onClick() event handler to redirect
                      > them after clicking the link, but you'd be dependent on them having
                      > Jscript turned on (which 95% of people do anyway).
                      >[/color]

                      You cannot nest links...a hack employed by black-hats on the web to do
                      very nasty things, up to date modern browsers will not fall for the trick.

                      TIP: in the future quote the part of the message that you are replying
                      to. Many folks use real newsreaders and not via webpage as Google Groups
                      and we do not see all the messages in a thread in a single window.

                      --
                      Take care,

                      Jonathan
                      -------------------
                      LITTLE WORKS STUDIO

                      Comment

                      • Chris Ianson

                        #12
                        Re: Play a sound when clicking a hyperlink?

                        <Jacob.Lyles@gm ail.com> wrote in message
                        news:1142738345 .734005.8560@g1 0g2000cwb.googl egroups.com...[color=blue]
                        > Hello,
                        >
                        > I don't know what I'm talking about, but might wrapping some text with
                        > nested links work, one for the web page and one for the sound? Lacking
                        > that, you could use a Javascript onClick() event handler to redirect
                        > them after clicking the link, but you'd be dependent on them having
                        > Jscript turned on (which 95% of people do anyway).[/color]

                        Thanks for a sensible reply to my question which was 'how to' do it (not
                        'should I' and 'please give your opinion on if it's a bad idea').

                        Can you give an example of such code that will call a URL hyperlink and play
                        a sound when clicked please.

                        Cheers!


                        Comment

                        • Barbara de Zoete

                          #13
                          Re: Play a sound when clicking a hyperlink?

                          On Sun, 19 Mar 2006 11:38:25 +0100, Chris Ianson <notme@hotmail. com> wrote:
                          [color=blue]
                          > <Jacob.Lyles@gm ail.com> wrote in message
                          > news:1142738345 .734005.8560@g1 0g2000cwb.googl egroups.com...
                          >[color=green]
                          >> I don't know what I'm talking about, but might wrapping some text with
                          >> nested links work, one for the web page and one for the sound?[/color]
                          >
                          > Thanks for a sensible reply to my question which was 'how to' do it (not
                          > 'should I' and 'please give your opinion on if it's a bad idea').[/color]

                          Well, this is a usenet newsgroup. What this implies is
                          <URL:http://groups.google.c om/group/alt.html/msg/846f8ab01cc6340 0>.

                          BTW: the nested links that are proposed, are not possible with html:

                          ,------[ <URL:http://www.w3.org/TR/html401/struct/links.html#edef-A> ]
                          | 12.2.2 Nested links are illegal
                          |
                          | Links and anchors defined by the A element must not
                          | be nested; an A element must not contain any other
                          | A elements.
                          `------


                          --
                          ______PretLette rs:
                          | weblog | http://www.pretletters.net/weblog/weblog.html |
                          | webontwerp | http://www.pretletters.net/html/webontwerp.html |
                          |zweefvliegen | http://www.pretletters.net/html/vliegen.html |

                          Comment

                          • Evertjan.

                            #14
                            Re: Play a sound when clicking a hyperlink?

                            Chris Ianson wrote on 19 mrt 2006 in comp.lang.javas cript:
                            [color=blue]
                            > <Jacob.Lyles@gm ail.com> wrote in message
                            > news:1142738345 .734005.8560@g1 0g2000cwb.googl egroups.com...[color=green]
                            >> Hello,
                            >>
                            >> I don't know what I'm talking about, but might wrapping some text
                            >> with nested links work, one for the web page and one for the sound?
                            >> Lacking that, you could use a Javascript onClick() event handler to
                            >> redirect them after clicking the link, but you'd be dependent on them
                            >> having Jscript turned on (which 95% of people do anyway).[/color]
                            >
                            > Thanks for a sensible reply to my question which was 'how to' do it
                            > (not 'should I' and 'please give your opinion on if it's a bad idea').[/color]

                            it seems a bad idea
                            [color=blue]
                            > Can you give an example of such code that will call a URL hyperlink
                            > and play a sound when clicked please.
                            >
                            > Cheers!
                            >
                            >[/color]

                            <bgsound src="silend.mid " id="song">

                            <a href="http://cnn.com/" onclick="return soundlink(this) ;">
                            Play Clip</a>

                            <script >
                            var where;
                            function soundlink(x){
                            where=x;
                            document.getEle mentById('song' ).src='3secSoun d.mid';
                            setTimeout('loc ation.href=wher e.href',3000);
                            return false;
                            }
                            </script>


                            --
                            Evertjan.
                            The Netherlands.
                            (Please change the x'es to dots in my emailaddress)

                            Comment

                            • Jonathan N. Little

                              #15
                              Re: Play a sound when clicking a hyperlink?

                              Evertjan. wrote:
                              [color=blue]
                              > Chris Ianson wrote on 19 mrt 2006 in comp.lang.javas cript:
                              >
                              >[color=green]
                              >><Jacob.Lyles@ gmail.com> wrote in message
                              >>news:11427383 45.734005.8560@ g10g2000cwb.goo glegroups.com.. .
                              >>[color=darkred]
                              >>>Hello,
                              >>>
                              >>>I don't know what I'm talking about, but might wrapping some text
                              >>>with nested links work, one for the web page and one for the sound?
                              >>>Lacking that, you could use a Javascript onClick() event handler to
                              >>>redirect them after clicking the link, but you'd be dependent on them
                              >>>having Jscript turned on (which 95% of people do anyway).[/color]
                              >>
                              >>Thanks for a sensible reply to my question which was 'how to' do it
                              >>(not 'should I' and 'please give your opinion on if it's a bad idea').[/color]
                              >
                              >
                              > it seems a bad idea
                              >
                              >[color=green]
                              >>Can you give an example of such code that will call a URL hyperlink
                              >>and play a sound when clicked please.
                              >>
                              >>Cheers!
                              >>
                              >>[/color]
                              >
                              >
                              > <bgsound src="silend.mid " id="song">
                              >
                              > <a href="http://cnn.com/" onclick="return soundlink(this) ;">
                              > Play Clip</a>
                              >
                              > <script >
                              > var where;
                              > function soundlink(x){
                              > where=x;
                              > document.getEle mentById('song' ).src='3secSoun d.mid';
                              > setTimeout('loc ation.href=wher e.href',3000);
                              > return false;
                              > }
                              > </script>
                              >
                              >[/color]
                              I like that idea 'cuz it will NOT work in my browser! You will only
                              annoy IE users. I also recall your cannot script it to turn on or off
                              the sound like Netscape's attempt at this with EMBED, it is background
                              sound *only* where you can control the looping and initial delay in
                              playing when the pages loads. Also your document will not validate with
                              BGSOUND element it was never part of HTML.

                              --
                              Take care,

                              Jonathan
                              -------------------
                              LITTLE WORKS STUDIO

                              Comment

                              Working...