Rate this script:  I Love it  /   I Hate it

RJS with toggle_slide if not visible only


Code


    <div style="height: 30px">
        <div style="float: left; padding: 0 0 0 180px">
            <%= link_to_remote("test_visibility" ,
                :with => "'is_visible=' + Element.visible('list_div')",
                :loading => "Element.show('getting_results')",
                :complete => "Element.hide('getting_results')",
                :failure => "alert('An error occured, please email us directly!')",
                :url => { :action => 'one_action' }) %>
        </div>
        <div id="getting_results" style="float: left; padding: 3px 0 0 30px; display: none;">
            <%= image_tag "ajax-loader.gif", :class => "image", :alt => "loading..." %>
        </div>
    </div>
   
    <div id="list_div" style="display: none;" >
    </div>
   

def one_action
      render :update do | page |
        page.replace_html 'list_div', :partial => 'one_partial'
        if params['is_visible'] == 'false'
          page.visual_effect :toggle_slide, 'list_div', :duration => 2
        end       
      end
end
Element.visible('list_div')

 

 
RJS with toggle_slide if not visible only scripts | RJS with toggle_slide if not visible only snippet | RJS with toggle_slide if not visible only example | RJS with toggle_slide if not visible only tutorial | RJS with toggle_slide if not visible only code