I"m sure this is easy to do, but I can't figure it out for some
reason. I'm writing a simple little function in Drupal (in script.js
in my theme) to display a different banner image (as a background for
an element) based on the URL. So, for instance, if the URL is
http://www.mysite.com/services,
Could you explain that construct? I'm no JS expert, and I haven't
seen it before.
Thanks.
> If you want to do it in JavaScript, you don't need jQuery, regular
> expressions, or indexOf. window.location (or just location) has several
> properties that give you different pieces of the URL. locati
OK, so if I try using that to set my banner, I come up with something
like this:
var img = {
'/ops/content/services': 'banner2.jpg',
'/ops/content/services': 'banner3.jpg',
}[location.pathname] || 'banner1.jpg';
$("td#header").css("background","url(/ops/sites/all/them
I'm trying to implement the CrossSlide plugin with Drupal and I'm not
having any luck. Based on some help I got from this group, I have
this code that sets a different banner depending on the URL in
script.js (at www.oregonpatrolservice.com):
Drupal.behaviors.setBanner = function (context) {
I'm trying to do some simple form validation, and I can get one
response to work but not another one. I have a simple form in a
sidebar block (in Drupal) that is an area calculator (user enters
length, width, and height, clicks Calculate button, and area field is
filled in via jQuery). That part
> $('#edit-square-area').after(''+errorMessage+'');
>
> - Richard
OK, thanks, that works in this case. But say for some reason I need
to add a class to the dynamically. What would the syntax be to
shift focus to that element after appending it to #edit-square-area so
that I could use addClass
On Aug 30, 2:06 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> This works fine for me:
>
> $("").appendTo("#main").text("appendTo").addClass("cool");
>
> as does:
>
> $('' + 'insertAfter' + '').insertAfter("#main").addClass('cool');
>
> See here for a full page example with both:
>
> http:/
OK, I know I'm not the first one to ask this, but I'm stumped. I'm
working on a Drupal site, and the client didn't like my nice block I
created for a little calculator, so they want a popup window instead.
So, I created a separate .htm page with the HTML for the form (four
fields plus a button to
8 matches
Mail list logo