Topic: BlindUP/Down into a form....?

hi all, barely know how to express myself here, but here it goes.

I stole the following bit of code from the rails default index page.  it's the bit about "ABOUT YOUR APPLICATIONS ENVIRONMENT'...  I loved the blind in and out thing it did... so who better to steal from?
Here is what i stole...

<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title>goeshere</title>
    <%= stylesheet_link_tag 'style' %>
    <%= javascript_include_tag :defaults %>
        <script>  function about() {
        if (Element.empty('about-content')) {
          new Ajax.Updater('about-content', '../free/*****', {
            method:     'get',
            onFailure:  function() {Element.classNames('about-content').add('failure')},
            onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})}
          });
        } else {
          new Effect[Element.visible('about-content') ?
            'BlindUp' : 'BlindDown']('about-content', {duration: 0.25});
        }
      }</script>
     
</head>
<body>
  <div id="wrapper">
     <div id="logo">

      <h1>***** goes here.</h1>

      <p>Next time</p>

    </div>
  <div id="welcome">
                   <div id="about">
          <h3><a href="../free/*****" onclick="about(); return false">Click here for your free Tip Sheet!</a></h3>
          <div id="about-content" style="display: none"></div>
        </div>
<% unless flash[:notice].blank? %>


now when i am on a page, say localhost:3000/free, and i click the link, nothing happens.

if i replace the ../free/***** line with the original code, it works...

can anyone help?

Re: BlindUP/Down into a form....?

<%= link_to_function "Click here for your free tip sheet!", "Effect.toggle('about-content','blind', { duration: 0.25 })" %>

Will do the trick.

In your <head>:

javascript_include_tag :defaults

Re: BlindUP/Down into a form....?

didn't work.

if i used 'about' it blinded up but did not blind back...

i already have that bit of code in the head...

should i get rid of the function in the head?

are you not missing the function in the link_to_function?

i'm at whits end here... please help a brother out.

also, should i be using a partial?

any advice will be a help!

Last edited by superbnerb (2007-10-13 08:05:51)