scriptaculous

Replace default browser jumping to #element_id with Effect.scrollTo ?

Hi ppl, so, the thing is : when someone clicks on a link to my website and page loads, prototypeJS is supposed to observe if there is a #elementId in the URL and stop browser from jumping to the element and do it with scrollTo(). I've seen this before but only with jQuery, but couldn't figure out how to do it with prototypeJS. ...

What is JQuery's equivalent of scriptaculous/prototype's auto-complete?

Prototype/scriptaculous can do an easy autosuggest in the input box. It's pretty much built in. How can I do that with JQuery? ...

Problem with Sortables in Scriptaculous

I'm having a problem with getting my divs to become sortable using Scriptaculous's Drag and Drop Library. <pre id="leftcol"> <div id="id0"><h3>Date and Time</h3><div class="moduleContent"></div></div> <div id="id14"><h3>Calculator</h3><div class="moduleContent"></div></div> </pre> <script type="text/javascript"> Sortable.create("leftco...

get the id/value/name of checkboxes generated in form with rails

I'm using a fields_for helper in rails with some text boxes. How can I get the ID of these text boxes to use in some Javascript? I would like to be able to manipulate the status of the other checked boxes by clicking on certain boxes. Thanks :) Stuff like: <% fields_for "[id][]", app do |fields| %> <%= fields.check_box :featu...

How to use Scriptaculous effects on error messages

I want to use some Scriptaculous effects on error messages. <% form_for(@page) do |f| %> <%= f.label :name %> <%= f.text_field :name %> <%= f.error_message_on "name" %> <%= f.label :content %> <%= f.text_field :content %> <%= f.error_message_on "content" %> <%= f.submit 'Create' %> <% end %> My first ide...

Trigger scriptaculous ajax autocompleter in the update function

I'm trying to create something a text input field where you can enter a kind of path. I try to help the user with autocompletion, so that he may click trough the path instead of writing it down. It works almost, but there is one little problem left. With this code: memoFolderAutoCompleter = new Ajax.Autocompleter('folderPath', 'selecto...

Categorized results – jQuery autocomplete plugin

Hi there! I'm looking for an autocomplete plugin that makes it easy to categorize search results. If that's unclear, take a look at Apple.com's search bar (top right). I know that script.aculo.us' autocomplete widget provides similar functionality, by allowing you to wrap text in a [span class="informal"]. Every class="informal" elemen...

highlight div or p after loading

Hello i need to highlight a div after my page is loading, i don't know if i should use a partial or something like that, the partial also has to have 2 variables disponible. Code to highlight after loading by 5 seconds: <div id="total_de_venta"> <% if @instalador.a_destajo? %> <div align="right"><b>Total de la venta: $<%= @venta.precio...

Scriptaculous drop down menu not working in views/show

My knowledge of Ruby on Rails and javascript is rudimentary so please forgive me if this question has a simple answer. I have a website that needs a multi level dropdown menu. I have adapted scriptalculous drop down menu which is working on a test copy of my website using mongrel. There are several pages each with its own layout. When I ...

Keep div inside view port or arbitrary div on scrolling

I'm trying to find a scriptaculous script (or create one) which keeps a vertical navigation bar "sticky" inside my viewport. While this may not be black magic (one could use the position:fixed css) there is a problem with this approach: If the navigation bar is longer than the viewport height the visitor won't be able to ever see the who...

Prototype + Scriptaculous: Migration Questions

We are using Prototype 1.5.1.1 along with Scriptaculous version 1.7.1. Tried upgrading to Prototype 1.6 branch (along with 1.8 branch of Scriptaculous), but seems some things must have changed - more than a few things do not work when we point our files to include the new versions (firebug is throwing all kinds of exceptions). I don't ...

document.createElement('script')... adding two scripts with one callback

I need to add prototype and then add scriptaculous and get a callback when they are both done loading. I am currently loading prototype like so: var script = document.createElement("script"); script.src = "http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js"; script.onload = script.onreadystatechange = callback; document...

Why did one of my effects stopped working after adding another effect?

I am new to all of this so sorry if this is a stupid question. I had previously created a lightbox affect for my contact form and had it working great. Clicked contact, lightbox popped up with the contact form that kept in a separate html page. The script references were as follows: <link rel="stylesheet" type="text/css" href="css/lig...

Scriptaculous two toggles at once

How can I toggle an element to blind and fade at once? I tried the code Event.observe(window,'load',function() { Event.observe($("delete"),'click',function() { Effect.toggle("entry","appear",{ duration: 2.0 }); Effect.toggle("entry","blind",{ duration: 2.5 }); }); }); One will run, but not both. ...

evalScripts:true does nothing with Ajax inplace editor

I have the following code to create an inplace editor: new Ajax.InPlaceEditor('artifact_pretty_display_date_110_in_place_editor', '/artifacts/set_artifact_pretty_display_date/110', {evalScripts:true}) The response looks good to after I change a date: Element.update("artifact_pretty_display_date_110_in_place_editor", "12/06/2008"); El...

IE7 and Scriptaculous Autocompleter running out of memory

In IE7 only, I'm getting a weird out of memory error when I run my Autocompleter.Local. The content downloaded is around 1 MB in terms, but it's done in the background (in a JSON file). function create_listeners() { jQuery('.auto_complete_field').each(function() { var terms_id = 'terms_' + jQuery(this).attr('id'); jQuery(this).af...

Prune Down Autocomplete Terms

I have a very large list of terms for use in an autocomplete box. I've been mulling over a few different scenarios for how to prune them down, but I haven't come up with anything great yet. Basically, the structure is very similar to a record label - An artist has albums An album has songs Individual songs could be popular, albums are...

Scriptaculous Effect.Grow() start from set size, not 0

I have a div that appears if errors were encountered during a processing step. I have a 'More Info' link which, when clicked, I would like to expand and show specific errors encountered. I thought I could use scriptaculous and the Effect.Grow() animation but this seems to always start from 0px x 0px and scale up. Is it possible to star...

Prototype/Scriptaculous Toggle Queue

I want to achieve an effect on a certain div with scriptaculous that does the following: The div will blindUp. After that effect is complete, the contents of the div will change. The div will then blindDown with the new contents. So I know there is the effect queue which is awesome, but how can the contents only after the blindUp eff...

Horizontal SlideUp SlideDown with Scriptaculous

Hello ! You may know the scriptaculous SlideUp effect. Well, It slides up a div vertically as a closing effect. I would like to make it work horizontal. There is an option for this : scaleX:true, scaleY:false But it doesn't work fine : the div jumps down before closing... Does anyone know how to use the slideUp effect for horizontal s...