Jun 2, 2008
Generic-user-small Mike E. 7 posts

Topic: Prototype and script.aculo.us / Adding a drop down menu

Hi Christophe,

Thanks for the reply. I think I understand what you’re saying. The problem is I don’t know CSS well enough to grab the relevant bits from the site you recommend. I’m having trouble integrating it with the CSS on my site. I’m really new at this. I’ve tried several times to make it work on my site, but I end up screwing up my site.

Mike

 
Jun 2, 2008
Generic-user-small Mike E. 7 posts

Topic: Prototype and script.aculo.us / Adding a drop down menu

I’m using tabbed navigation menus on my site. I’d like to add a drop down menu to the ‘products’ tab, something like Widget1, Widget2, Widget3, etc. I’ve tried to get it to work but I’m just not getting it.

Here’s a very stripped down version of the site:
http://64.58.198.103/www.PRACTICE_MENUS.com/home.html

When the mouse moves over the rectangular ‘products’ box, a drop down menu should appear.

Any help would really be appreciated.

Thanks,
Mike

 
May 2, 2008
Generic-user-small Mike E. 7 posts

Topic: Prototype and script.aculo.us / Replace dashes with other text

Thank you so much for the demo. That is just what I need to get me started.

I really appreciate your help.

Excellent!

Mike

 
May 1, 2008
Generic-user-small Mike E. 7 posts

Topic: Prototype and script.aculo.us / Replace dashes with other text

Hello Christophe,

I realize it’s been a while since I posted this message. I’ve been unavoidably busy and I’m just getting back to this project this week.

I tried to implement your suggestion but I wasn’t able to figure out how to set it up properly. Please remember that I’m a javascript ultra-newbie. I have no idea what you mean by “I’d go gsub with a replacement function and a lexical closure to iterate over an array of answers from one replacement to the next.” Sounds good and I’m sure it will work. I’m just not sure how to set it up.

Would it be too much to ask if you could walk me through your solution or just show me how to set it up?

Thank you so much for your help.

Mike

 
Mar 31, 2008
Generic-user-small Mike E. 7 posts

Topic: Prototype and script.aculo.us / Replace dashes with other text

I’m trying to replace a dashed line with an answer after a “click here” prompt. Here’s an example:

1) Find the principal parts of the verb “drive” by filling in the blanks below. Click here to check your answer.

I _ now. (Present tense)
I _
in the past ( past tense)
I have __ every day. (Past participle)

After “Click here” is clicked, the above will be changed to:

I drive now. (Present tense)
I drove in the past ( past tense)
I have driven every day. (Past participle)

Is there a way to do this with javascript/scriptaculous? I’m building an instuctional site on English grammar. I’d appreciate some help.

Thanks,
Mike

 
Mar 28, 2008
Generic-user-small Mike E. 7 posts

Topic: Prototype and script.aculo.us / How to highlight one sentence of paragraph

Thank you so much for your response.

Here’s what I have so far.


<head>
...
    <script type="text/javascript" src="/javascript/prototype.js"></script>
    <script type="text/javascript" src="/javascript/scriptaculous.js?load=effects"></script>
     <script type="text/javascript">
        function handleCheckLinks(e) {
        var activator = e.findElement('a.answerChecker');
        if (!activator)
        return;
        e.stop();
        activator.up('p').previous('p').down('span.answer').highlight();
        }

        document.observe('click', handleCheckLinks);
    </script>
...

<p><a href="#" class="answerChecker">Click here</a> when you are finished.</p>

<p class="Rightbar_body_green">November and December are 
wonderful months for gardening in the south. While residents 
of northern states are more concerned with preparations for 
winter, gardeners in southern states can enjoy natural 
circumstances that enhance their efforts. 
<span class="answer">Football enthusiasts in November 
and December can enjoy the sport throughout the country.</span> 
Temperatures in the south are warm enough to grow abundant 
amounts of flowers and vegetables. Plants and gardeners are 
relatively free from the pesky bug populations that present 
problems during the summer. If you enjoy gardening, you'll 
find November and December good months in the south.</p>
</head>

A few questions:
1. It doesn’t work if the ‘Click here’ sentence is before the main paragraph.
2. How do I change the color of the incorrect sentence?
3. I would also like the answer to remain highlighted after clicking ‘Click here’.

Please forgive my lack of knowledge. I’m very new to javascript.

Thanks again,
Mike

 
Mar 28, 2008
Generic-user-small Mike E. 7 posts

Topic: Prototype and script.aculo.us / How to highlight one sentence of paragraph

I need some help with the HighlightEffect function to highlight one entire sentence of a paragraph. The onclick action needs to come from outside the paragraph. In the example below, the third sentence will be highlighted in red after clicking on the “Click here to check your answer,” sentence that follows the paragraph.

For example:

November and December are wonderful months for gardening in the south. While residents of northern states are more concerned with preparations for winter, gardeners in southern states can enjoy natural circumstances that enhance their efforts. Football enthusiasts in November and December can enjoy the sport throughout the country. Temperatures in the south are warm enough to grow abundant amounts of flowers and vegetables. Plants and gardeners are relatively free from the pesky bug populations that present problems during the summer. If you enjoy gardening, you’ll find November and December good months in the south.

Click here to check your answer.

Any ideas on how to do this? I’m new to script.aculo.us if it’s not obvious. Just need a little help.

Thanks,
Mike

7 posts