content swap/reval using CSS, <div> & Javascript - HOW???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • obwatter
    New Member
    • Apr 2008
    • 3

    content swap/reval using CSS, <div> & Javascript - HOW???

    i'm trying to recreate what i *think* should be a simple CSS/JS <div> content reveal / swap.

    just like this one ("A Tale of Two Pets", near bottom of page):

    http://www.castorpollu xpet.com/our_story

    been trying to figure it out on my own for about 2 days now & have run out of ideas.

    *** NOTE: my JS skills are currently limited to rollovers & pasting snippets written by "the javascript guy" who used to work in our office.


    THANKS!!!
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    have you tried to right click on the current page and "view source" to see how they did it?

    Comment

    • obwatter
      New Member
      • Apr 2008
      • 3

      #3
      yeah - tried that. they've used an external JS file (a few of them, actually) and even when i open the files, there's so much there - i'm not sure what to pull out....

      ;(

      Comment

      • Stang02GT
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        what is that called? When you click on the pic it changes....if you give me a name of what that function is called i should be able to help ya out.

        Comment

        • obwatter
          New Member
          • Apr 2008
          • 3

          #5
          erm, no idea. i really am quite clueless. keep getting an error : "element has not been defined"...but i'm not sure what/how i should define.

          all seems to revolve around showing or hiding the appropriate div following a 'click' event. here's a bit of the code:

          [HTML]<div id="story1" class="story">< a href="javascrip t:;" onclick="Elemen t.show('story2' );Element.hide( 'story1');"></a>

          <a href="javascrip t:;"onclick="El ement.show('sto ry2');Element.h ide('story1');" ></a>

          <a href="javascrip t:;" onclick="Elemen t.show('story2' );Element.hide( 'story1');">

          <a href="javascrip t:;" onclick="Elemen t.show('story2' );Element.hide( 'story1');"></a>
          [/HTML]
          thnx
          Last edited by acoder; Apr 8 '08, 11:01 AM. Reason: Added code tags

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Moved to the JavaScript forum where you'll get more help.

            Moderator.

            Comment

            Working...