0

So what I would like to do is great a sliding door effect for my drupal site using jquery-ui action. Does anyone know of examples or a module for this?

Also I would like the action to execute on two triggers. -open close sliding door on "menu link to new node click" -close sliding door once node is loaded

I've seen example for what I want to do and I know that you can insert jquery-ui. All I need to know is where do I need to insert the jqurey-ui. Examples would be great!

1

It depends on what page you need to add the script, adding jquery_ui is fairly straightforward if you know which component it is.

You should add the following line in the template.php (changing the ui.autocomplete to what you need)

drupal_add_library('system', 'ui.autocomplete');

The following page is extremely useful https://drupal.org/node/171213

Update as described in comments

function MY_THEME_preprocess_html(&$variables) {
    if(arg(0)=='node' && arg(1) === 3)) {
        $node = node_load(arg(1));
        drupal_add_js('system', 'ui.autocpmplete);}
       }
    }
|improve this answer|||||
  • I think you nailed it on the head. " depends on what page you need to add the script" So this means that the line you mention, controls the action of the way the whole system? Lets say I want to change node/3, I would change the line or add a line? So drupal_add_library('node/3', 'ui.youractiontojqueryscript'); , would be what you mean? – Benjamin Jones Oct 24 '13 at 13:41
  • 1
    not quite, the second argument 'system' is the module that registered the js. If you want only to load it on the node/3 hook_node_view($node, $view_mode, $langcode) then inside that function use some logic to add to the nodes that match the node id you want ..see above – Daniel Harper Oct 24 '13 at 15:16
  • Thanks. Ya here's basically what I will be trying to accomplish, but not by pulling a rope and will only close when link to certain node is clicked. rawgallery.us/curtains/index.html . I'll see what I can do. Thanks! – Benjamin Jones Oct 24 '13 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.