Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
2 answers
598 views

Why is an integer variable in PHP interpreted as a string literal when passed from Drupal to JavaScript via Drupal.settings?

This is in Drupal 7. I'm attaching some JavaScript via drupal_attach_js(), using "settings` to be able to pass the "height" parameter to a JavaScript function. The height is used in a modal dialog, ...
1 vote
2 answers
1k views

Every five seconds without refresh the new web page

How can I on a drupal site do a partial refresh of a page's content with AJAX every 5 second?
0 votes
1 answer
360 views

JavaScript and CSS settings fail unexpectedly: The files were not created [duplicate]

Possible Duplicate: Drupal Commons site has no style after installation See the Drupal Commons site running on boysday.org well how to start. i am new to drupal and I have serious flaws during ...
0 votes
3 answers
2k views

How to include jQuery UI on a page without PHP?

I want to include jQuery widgets on my Drupal 7 page. So, I started the way is described here: drupal_add_library('system', 'ui.dialog'); drupal_add_js('jQuery(document).ready(function(){jQuery("#...
0 votes
2 answers
615 views

How to implement a jscript for displaying custom ads

I am very much a beginner with scripting, drupal theming, etc and I cannot figure out how to deal with the following "problem": I have signed up my site with a media network, which will handle all ...
3 votes
1 answer
525 views

drupal_add_js(), script not executed

I try to include a simple script (below) and cant get it to work. (function ($) { Drupal.behaviors.myModuleBehavior = function (context) { alert('say something pretty please'); } })(jQuery); ...
4 votes
2 answers
1k views

How to trigger JavaScript/jQuery on AJAX-enabled ImageField submit?

I'm trying to trigger a JavaScript event when an AJAX-enabled ImageField submit button is clicked. I've tried variations on delegate(), submit(), and click(), but no joy. This is something similar ...
1 vote
3 answers
761 views

In hook_boot jQuery is undefined

I am doing some processing in hook_boot since I need that code to run on every page, irrespective of whether or not they are cached. As a result, jQuery is undefined when I add inline JavaScript to ...
1 vote
0 answers
536 views

Lightbox2 with CCK fields, duplicate images in articles

I'm having some trouble with Lightbox2 for Drupal 7, or rather I don't know how to configure it properly. In my desperate search for a tool that will handle inserting scaled image thumbnails with ...
14 votes
2 answers
8k views

Changes in the way Drupal 7 handles JavaScript and jQuery

I'm currently developing a JavaScript script that runs on an administration page. I read up on the changes made in Drupal 7, namely the move from document.ready() to its own jQuery function. However, ...
1 vote
1 answer
478 views

Pager for multivalued node field

There is a plenty of plugins for building all kinds of sliders and carousels with Views. But frequently I find myself in a situation, when I need to make some kind of slider not for a whole node but ...
0 votes
1 answer
959 views

Caching interfering with jQuery and drupal behaviors?

I'm on the new side to coding so this is mysterious to me: On several sites that I'm working on the jQuery library stops being added through drupal behaviors spontaneously as javascript and module ...
1 vote
1 answer
1k views

What would be the Drupal way to have a preloader overlay divs untill they were finished loading?

I am trying to get a theme to have a pre-loader image run over each section of the theme until the corresponding div section is finished loading. I am trying to refrain from a $(window).load(...
1 vote
2 answers
708 views

How to show single pop-up for whole guest session

In my site I want to place a javascript ad code( from Zedo) which is popping up one window for each page visit by the user which is quite nagging. Ideally what I want is to pop up the ad after user ...
1 vote
1 answer
1k views

Show jCarousel if number of items are more than 3

I am using the jCarousel Views module; I want to hide the view when the number of items are not greater than 3. How do I do it?
0 votes
1 answer
586 views

Updating duplicate Flags AND one or more Views blocks on a page on Flag click

I have a page where I have several carousel views that can, at times, show the same item/node in each carousel. Such as a most downloaded and a most viewed. I have two different flags (bookmarks and ...
-1 votes
1 answer
993 views

How to add a timer in views?

I have created a view which displays a list of product in table grid formate with four rows. I have fields related to the product like image,price,descriptions and so on. Now I want to create a field ...
1 vote
1 answer
482 views

jQM Theme does not work properly on front page

I've started to use Drupal recently, and installed the jQuery Mobile module and the jQM Theme in order to make a Mobile site / Web app. I'm having some troubles getting it to work properly. The ...
1 vote
1 answer
117 views

How to retrive menu_get_object() in javascript, jQuery?

I'd like to use the $node object in JavaScript, preferably Drupal's DOM. Is there a recommended way to do this in Drupal?
0 votes
1 answer
976 views

Contact Form with drop-down subject (bonus: auto-selected based on GET/POST)

I have a number of services on my site and I want them to all direct to the contact form. Now, this is where it gets tricky- I want the subject to be a dropdown selection of all services provided and, ...
0 votes
2 answers
2k views

How to remove overlay hashtag and trailing menu from the parent overlay

Lets say for example we have activated contextual links & overlay modules and when clicking the edit button for the node, which is all the way bottom of the page, it open on overlay. Now when we ...
0 votes
1 answer
491 views

Load page through ajax

what are the options (all possible ways) to open a page through ajax in D7?, also can ctools module be useful in this? if yes then can anyone provide an example hint using ctools.
3 votes
1 answer
1k views

Any better popup modal framework in drupal

I use the Chaos tool suite module for modal popup in Drupal 7; I am unable to open popup from within a popup using ctools. Can it be done using ctools, or is there any better popup modal module in ...
8 votes
2 answers
1k views

Weighting Javascript in .info files

Drupal 7 adds a new 'weight' option to drupal_add_js so that you can control the order in which Javascript files are added to the page. Is there any way to do this when adding Javascript in .info ...
0 votes
1 answer
143 views

.js extension for javascript file is missing

I am using below code in my custom module "my_module". function my_module_theme(){ return array( 'my_module_javascript'=>array('arguments'=>array(),), ); } ...
2 votes
2 answers
503 views

How do I create a "quick post" bookmarklet for use with Drupal 7?

I'm trying to create a bookmarklet. This is not working: javascript:window.location="http://domain.com/node/add/content_type?title="+encodeURIComponent(document.title) The Prepopulate module is not ...
2 votes
1 answer
598 views

WYSIWYG error when using managed_file and AJAX

I have a form that has both a managed_file element and a text_format element. Both are encapsulated in a wrapper div (using #prefix and #suffix). On submit, an AJAX callback is executed and both ...
1 vote
1 answer
457 views

Drupal 7 js compression generating 6 files

I'm using drupal_add_js and drupal_add_library to add some js to my site. But when I turn on the drupal js compression, drupal is aggregating the files but it's generating 6 files and Yslow is saying ...
2 votes
0 answers
295 views

Create splash ad?

Drupal 7.7. I have front_page installed and working for Anonymous users - testing it out with a ten-second expiring cookie and this: <?php print 'Splash Ad!<br/><a href="index.php">...
3 votes
1 answer
2k views

Client-Side Equivalent of drupal_set_message with javascript

I've got javascript that notifies the user of actions and errors, and I'd like to use the existing Drupal messaging. Is this built in to Drupal? Alternatively, (I'm fairly new to Drupal and am not ...
0 votes
1 answer
665 views

drupal_add_js does not add javascript on after_build

I'm using the following line to add JavaScript code to my module form: $form['#after_build'][] = 'myModule_after_build' In myModule_after_build(), I add the Javascript code with calling ...
4 votes
1 answer
913 views

Are there any alternatives to drupal_add_js()?

Are there any alternatives to drupal_add_js() that permit to write inline JavaScript code?
2 votes
1 answer
1k views

How to onclick-trigger a non-native jQuery plugin's action?

I've installed a 3rd-party jQuery plugin (it's an accordion). It displays on my page, and works as expected. I want to trigger one of the plugin's actions (open a particular slide) when I click on ...
1 vote
1 answer
4k views

How to add jQuery.LocalScroll to Drupal 7?

I'm trying to add smooth scrolling within a page. I did find out it could be done using jQuery.LocalScroll. What I've done so far: 1. I use Zen subtheme, so into my .info file I put: scripts[] = js/...
3 votes
1 answer
674 views

How to use JQM theme and jQueryMobile plugin with Drupal?

I'm developing a mobile web site with Drupal 7 and i want to use jQuery mobile. I've found many plugins, but just one available with drupal 7 (jQuery Mobile module). I have also a jQuery mobile theme (...
4 votes
1 answer
3k views

How to close login-popup after successful login

I'm working on a FF-extension, that displays user-specific information on 3rd-party websites. Users need to be logged in to my Drupal-website. I'm checking login state with a cross-domain-proof jQuery....
1 vote
2 answers
1k views

Adding a clickable area to the logo

At my Drupal 7.4 website with the default Bartik theme and no contributed modules, I have a big logo (715 x 280 px) and no slogan. These are my settings: I'm trying to figure out the best way to add ...
2 votes
3 answers
3k views

Drupal caching prevents cookie read

On one of my production sites I wrote a jQuery stylesheet switcher. It drops a cookie when a selection is made and uses php to select the corresponding stylesheet on pageload which overrides styles. ...
3 votes
1 answer
3k views

First AJAX request is working very well, next takes too much time

I'm working on ajaxing my site, for a long time now. I found a method that's working for me, but only the first AJAX request is working the right way; the next request takes at least twice the time. ...
5 votes
3 answers
2k views

Views Slideshow vs list View+jquery cycle lite?

The rotating images on my work site's home page are created as a View in list format. I'm using the jQuery Cycle Lite plugin for the rotator effect. The cycle.lite.js file is set in the scripts array ...
1 vote
2 answers
2k views

Can't Remove Image from CCK File Field when editing node (Throbber just spins)

I was able to upload an image, but the thumbnail didn't appear until I hit save on the form. When I try to remove the image, it just sits there spinning the throbber; if I click on "Save" in the form,...
1 vote
0 answers
465 views

Figure out the difference between loaded JS, CSS files, and files needed to be loaded for new content

I'm looking for a way to figure out what CSS and JavaScript files are loaded, and what else CSS and JavaScript files needed to be loaded for new content I'm injecting with AJAX. I've am module file, ...
11 votes
2 answers
19k views

Force Drupal to attach Drupal behavior to new ajaxed content [only Drupal.attachBehaviors() is not working the right way]

I was doing lot of posts on drupal.org about this topic, but unfortunately in the wrong context. Ajaxed content is not attaching needed JS and CSS (forum) Ajaxed content is not attaching needed JS ...
3 votes
1 answer
2k views

What are the available image sliders?

I want to know what sliders are available for Drupal 7, and which ones can be used in blocks.
5 votes
3 answers
2k views

External JS libraries

I have a few external js files that I call in my page, at the moment these are called via script tags in the header. I am tempted to pull these locally and include them in my themes script file to ...

1
16 17 18 19
20