search for: visual_effect

Displaying 20 results from an estimated 179 matches for "visual_effect".

2009 Jan 20
4
Shared templates across controllers
...uite similar. Because their CRUD behavior is executed via AJAX, the "templates" for the actions are all short .rjs files. Now, because of the similarity of the models, most of the templates are exactly the same, with only the object names changed. That is, where one looks like this: page.visual_effect :toggle_slide, ''hidden_testimonial_form'' page.visual_effect :toggle_slide, ''add_testimonial_button'' The other looks like this: page.visual_effect :toggle_slide, ''hidden_service_form'' page.visual_effect :toggle_slide, ''add_service_butt...
2006 Apr 03
5
RJS Queue
Hi, I''ve been able to succesfully queue page.visual_effect commands in my RJS templates. Each command will wait to execute until the previous command is done executing. But I''d also like to execute a page.replace_html command AFTER the page.visual_effect commands. I have a series of five DIVs: div1 div2 div3 div4 div5 When the user clicks...
2006 Jun 26
1
RJS visual_effect toggle?
Is there a way to toggle an effect in an RJS? If not, anyone have recommendations for how to manually make it toggle? I guess I would assume some boolean that the rjs checks everytime it''s called and depending on whether it''s true or false it will do page.visual_effect :appear or page.visual_effect :hide -Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2006 Apr 07
1
changing visual_effect defaults
what is the correct syntax for changing an effect like :highlight? i tried looking through the api, and found it, but i can''t seem to get it right. i want to change the start color of visual_effect(:highlight, ''user-list''). i tried visual_effect(:highlight, ''user-list'', :startcolor = ''#990000'') and several other variations of that, but i can''t seem to get it right. -- Posted via http://www.ruby-forum.com/.
2006 Apr 03
4
page.visual_effect :highlight not working
I just upgraded Ruby to 1.8.4 and Rails to 1.1 and I''m in the middle of changing my Javascript code over to the Scriptaculous helper functions. page.visual_effect :highlight, "some_div" seems to be broken. Instead of fading, the background color of the element stays highlighted. page.visual_effect works for other effects, though. Any ideas? Thanks. -- Posted via http://www.ruby-forum.com/.
2006 Feb 18
2
Effect queues with RJS templates and scriptaculous
Hi. I was wondering if it''s possible to combine effects for individual elements with RJS templates. I notice that scriptaculous has support for a concept called effect queues (http://www.railsdevelopment.com/2006/01/15/effectqueue/). Is there anyway to use these queues from rjs?
2006 Jul 21
1
RJS Failing
...@num_cats} categories" page[''no-links''].remove if @num_links == 1 && page[''no-links''] page.insert_html :after, "category-#{new_link.category_id}", :partial => ''link'', :object => new_link page.visual_effect :highlight, "link-#{new_link.id}" page.replace_html ''new_link_error'', '''' page[''link_url''].value = ''http://'' page[''link_name''].value = '''' page['...
2006 Aug 09
2
Can :before and :success move from view file into .rjs file?
Within the RJS template is there a way to specify when the visual_effect should occur? I''m trying not to repeat the :before and :success blind_down visual_effect statements throughout my views. It seems like the rjs templates can only take visual effects statements in the form of page.visual_effect :blind_up, ''divname''. I can''t f...
2006 Jan 10
5
using dynamic element ids with visual_effect
...add_product(product) if request.xhr? headers[''X-Item-Id''] = item.object_id render(:action => "display_cart", :layout => false) else redirect_to(:action => ''index'') end end I''d really like to use visual_effect() instead of having my own flash_cart method, but I can''t think of a way of giving it the element ID dynamically. Am I missing something? Cheers Dave
2006 Jan 19
1
rjs problems
...m having trouble with rjs templates. Basically I want the item_div to fade if its already open and then display the new item that the user selected with the visual effect: appear. The code below causes the browser (firefox on osx) to open the div and then close it again as soon as it is open: page.visual_effect :fade, ''item_div'', :duration => 0.5 page.replace_html ''item_div'', :partial => ''edit'' page.visual_effect :appear, ''item_div'', :duration => 0.5 Does anyone have any ideas or can anyone point me to some documentation tha...
2006 Apr 07
1
Validate_presence_of error in nested object is not displayed
...do |page| page.replace_html "table", :partial=>"table" page.replace_html "pagination", :partial=>''pagination'' page.replace_html "msgs","Contact successfully added ",:queue=>''end'' page.visual_effect :fade,''operations'',:duration=>0.5 page.visual_effect :appear,''contentTable'' page.visual_effect :appear, ''msgs'',:queue=>''end'' page.visual_effect :fade, "msgs",:duration=>2,:queue=>''end...
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute? <div id="new_item_details" style="display:none"></div> <%= link_to_function("Show details...", nil, :id => "show_details") do |page| page.visual_effect(:toggle_blind, :new_item_details) if (page[:new_item_details].style.visibility == "none") <----------------------------------------????? page[:show_details].replace_html "Hide details" else page[:show_details].replace_html "Sh...
2006 Apr 05
23
how to create RJS visual effects callbacks
...new image back in. How would I go about this in RJS Here''s a simple line from my rjs that I can''t get to work. It is not using callbacks so the "comment_error" div is being replaced before the fade out. I can''t find any documentation on the subject. page.visual_effect :fade, ''comment_error'', :duration => 0.5 page.replace_html ''comment_error'', "#{error_messages_for(''comment'')}" page.visual_effect :appear, ''comment_error'', :duration => 0.5 -- Posted via http://www.ruby-fo...
2006 Mar 08
2
fade out and then fade in....how to make it work?
...ying (this does not work) <%= link_to_remote(image_tag(url_for_file_column(product, "image_url"), :update => ''right_content'', :url => { :action => :product_details, :id => product.id }, :loading => visual_effect(:fade, "right_content", :duration => 0.5 ), :complete => visual_effect(:slideDown, "right_content", :duration => 0.5 ) )%> -- Posted via http://www.ruby-forum.com/.
2007 Nov 30
0
visual_effect not taking parameters in RC2
Hi all, I just upgraded a half baked app to RC2 and found a problem with passing parameters to the visual_effect method, particularly :enddcolor and :startcolor. Firebug does not report any error but the method just fails silently. If i remove the parameters, the method works just fine albeit with the default colors. Has anyone else found this problem? --~--~---------~--~----~------------~-------~--~----~ Y...
2006 Oct 09
2
page.visual_effect :highlight
...r yellow then the last time. If you do the multiple fire thing a few more times, each time you stop it will get a bit darker still. This was happening in both Firefox and IE. Does anyone have any experience with this? Here is the code in my controller: render :update do |page| page.visual_effect :highlight, @card.to_s, :duration => 0.5, :startcolor => "''#ffff00''", :endcolor => "''#f1eded''" end -- Posted via http://www...
2006 Jul 20
5
RJS where to put helper method?
Hi, If I want to have helper method for my rjs, where''s the best place to put it? so for example: --- bla.rjs: page.replace_html ... page.visual_effect ... --- somewhere: (currently I put in application_helper.rb) def replace_with_effect(page) page.replace_html ... page.visual_effect ... end --- bla.rjs: replace_with_effect page and is there a way to define the helper so we don''t have to pass the page into the function everytime?...
2006 Jul 31
4
RJS to find an element
...there is more than one of that particular item in the cart. If the item deleted is the only of it''s kind it gets removed from the document before the highlight is "activated". page[:cart].replace_html :partial => ''cart'', :object => @cart page[@div].visual_effect :highlight, :startcolor => "#88ff88", :endcolor => "#114411" Is there a way to use RJS to see if page[@div] (in this case) exists before I try to do the highlight? Thanks, Jake
2006 Apr 28
1
startcolor and endcolor not working
In my RJS template this works: page.visual_effect :highlight, "test#{@test.id}", {:duration => 5} but not this: page.visual_effect :highlight, "test#{@test.id}", {:duration => 5, :startcolor => "#FFFFFF"} Am I misunderstanding how to pass in additional parameters? ________________________________________...
2006 Apr 07
5
RJS support "toggle" effect?
Does RJS inherently support the Element.toggle effect? I haven''t been able to call it the way you call "appear", "fade", etc... Jeff -- Posted via http://www.ruby-forum.com/.