Hello,
I'm trying to add a onClick setting to the views slideshow imageflow module.
Everything works great except that when I add the onClick setting it doesn't work.
This is what is outputted by drupal:
jQuery.extend(Drupal.settings, { "basePath": "/websites/shooky/", "admin_menu": { "margin_top": 1 }, "thickbox": { "close": "Close", "next": "Next \x3e", "prev": "\x3c Prev", "esc_key": "or Esc Key", "next_close": "Next / Close on last", "image_count": "Image !current of !total" }, "imageFlow": { "views-slideshow-imageflow-images-1": { "aspectRatio": "1.964", "imagesHeight": "0.67", "imageCursor": "pointer", "sliderCursor": "pointer", "startID": 1, "slider": 1, "captions": 1, "imageFocusM": "1.0", "scrollbarP": "0.6", "imageFocusMax": "4", "onClick" : "alert('tets');" } } });
the part with the onClick, does nothing. What am I doing wrong?
Thanks
Idan
jQuery.extend(Drupal.settings, { "basePath": "/websites/shooky/", "admin_menu": { "margin_top": 1 }, "thickbox": { "close": "Close", "next": "Next \x3e", "prev": "\x3c Prev", "esc_key": "or Esc Key", "next_close": "Next / Close on last", "image_count": "Image !current of !total" }, "imageFlow": { "views-slideshow-imageflow-images-1": { "aspectRatio": "1.964", "imagesHeight": "0.67", "imageCursor": "pointer", "sliderCursor": "pointer", "startID": 1, "slider": 1, "captions": 1, "imageFocusM": "1.0", "scrollbarP": "0.6", "imageFocusMax": "4", "onClick" : "alert('tets');" } } });
onlick can not be added this. It's added in a JS file or via "inline" JS. Then it's added to a jQuery object like this:
$("some selector").onclick(function(){alert('test')});
where "some selector" is a CSS selector.
Looks to me like you need to read a tutorial in jQuery to understand how it works.
HTH
Thanks for the help,
I actually understand that part, but I think in this script the onClick is both..maybe going by this:
http://finnrudolph.de/ImageFlow/Documentation
this is an example:
var Highslide_1 = new ImageFlow(); Highslide_1.init({ ImageFlowID: 'Highslide_1', onClick: function() { return hs.expand(this, { src: this.getAttribute('longdesc') } ); } });
http://finnrudolph.de/ImageFlow/Combinations
let me I'll try adding it inline.
Thanks
Idan
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Fred Jones Sent: Saturday, December 26, 2009 8:54 PM To: support@drupal.org Subject: Re: [support] adding an Onclick setting to jquery drupal settings
jQuery.extend(Drupal.settings, { "basePath": "/websites/shooky/", "admin_menu": { "margin_top": 1 }, "thickbox": { "close": "Close", "next": "Next \x3e", "prev": "\x3c Prev", "esc_key": "or Esc Key", "next_close": "Next / Close on last", "image_count": "Image !current of !total" }, "imageFlow": { "views-slideshow-imageflow-images-1": { "aspectRatio": "1.964", "imagesHeight": "0.67", "imageCursor": "pointer", "sliderCursor": "pointer", "startID": 1, "slider": 1, "captions": 1, "imageFocusM": "1.0", "scrollbarP": "0.6", "imageFocusMax": "4", "onClick" : "alert('tets');" }
}
});
onlick can not be added this. It's added in a JS file or via "inline" JS. Then it's added to a jQuery object like this:
$("some selector").onclick(function(){alert('test')});
where "some selector" is a CSS selector.
Looks to me like you need to read a tutorial in jQuery to understand how it works.
HTH
I actually understand that part, but I think in this script the onClick is both..maybe going by this:
...
I still think you're confused. Drupal settings is jQuery and AFAIK it has nothing to do with this ImageFlow tool you mention. I do not think you can mix them together.
HTH
Thanks for the help, I was basing all my assumptions on the module I was trying to hack.
I've got another strange ajax/js problem that I'd really appreciate your insight into: I'm trying to load a page node with cck tabs into a container div, using ajax. I've got the page loaded, but the cck tabs disappear, I have no idea what is causing this.
I'm using an ajax script I found online, tried a couple both with the same result.
http://idanarbel.com/websites/shooky/%D7%AA%D7%A4%D7%A7%D7%99%D7%93%D7%99%D7 %9D
if you click on the center image of the man with the horn, it will load a page below (very rough at the moment).
I'm loading this page:
http://idanarbel.com/websites/shooky/node/130
which you can see has the tabs.
I'd really appreciate if you point me in the right direction here.
Idan -----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Fred Jones Sent: Saturday, December 26, 2009 9:35 PM To: support@drupal.org Subject: Re: [support] adding an Onclick setting to jquery drupal settings
I actually understand that part, but I think in this script the onClick is both..maybe going by this:
...
I still think you're confused. Drupal settings is jQuery and AFAIK it has nothing to do with this ImageFlow tool you mention. I do not think you can mix them together.
HTH
I've got another strange ajax/js problem that I'd really appreciate your insight into: I'm trying to load a page node with cck tabs into a container div, using ajax. I've got the page loaded, but the cck tabs disappear, I have no idea what is causing this.
I don't think you can just load a complicated page into a DIV with ajax and expect it work. Usually Ajax loads just a snippet, not a whole page.
Looks like your site http://www.studentdesign.co.il/designer/free-adobe-presenter-7-download-free... has been spammed.
בהצלחה Fred
Hi,
Thanks for the tip on studentdesign.
I found a tutorial here: http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con...
On how to do it with lightbox2. But still with the same result, and this time just the content part and NOT the entire page.
Look here:
http://idanarbel.com/websites/shooky/%D7%AA%D7%A4%D7%A7%D7%99%D7%93%D7%99%D7...
click the ajax test link.
Thanks
Idan
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Fred Jones Sent: Saturday, December 26, 2009 10:20 PM To: support@drupal.org Subject: Re: [support] adding an Onclick setting to jquery drupal settings
I've got another strange ajax/js problem that I'd really appreciate your insight into: I'm trying to load a page node with cck tabs into a container div, using ajax. I've got the page loaded, but the cck tabs disappear, I have no idea what is causing this.
I don't think you can just load a complicated page into a DIV with ajax and expect it work. Usually Ajax loads just a snippet, not a whole page.
Looks like your site http://www.studentdesign.co.il/designer/free-adobe-presenter-7-download-free... has been spammed.
בהצלחה Fred
I found a tutorial here: http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con...
On how to do it with lightbox2. But still with the same result, and this time just the content part and NOT the entire page.
That's fantastic! The code is working perfectly then. Because that's *exactly* what that tutorial wants to achieve--to load just the content of a node via Ajax.
People here will be happy to provide support with Drupal questions, but I will repeat what I said before--you need to learn how jQuery works. That or find a programmer who understands it. This list, however, is not the place to learn jQuery.
Fred
Hi,
Thank you for your assistance, you've been a very helpful and patient and I appreciate it. I'll keep on working on my issue of the tabs that aren't appearing.
Once, again thanks for your time and for the help. I really appreciate it.
Idan
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Fred Jones Sent: Saturday, December 26, 2009 10:34 PM To: support@drupal.org Subject: Re: [support] adding an Onclick setting to jquery drupal settings
I found a tutorial here:
http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con tent
On how to do it with lightbox2. But still with the same result, and this
time just the content part and NOT the entire page.
That's fantastic! The code is working perfectly then. Because that's *exactly* what that tutorial wants to achieve--to load just the content of a node via Ajax.
People here will be happy to provide support with Drupal questions, but I will repeat what I said before--you need to learn how jQuery works. That or find a programmer who understands it. This list, however, is not the place to learn jQuery.
Fred
If you are doing JQuery.load you can put a selector in the URL. That way it will only return the part of the page you want. See this page for details:
http://docs.jquery.com/Ajax/load
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/26/2009 3:40 PM, Idan Arbel wrote:
Hi,
Thank you for your assistance, you've been a very helpful and patient and I appreciate it. I'll keep on working on my issue of the tabs that aren't appearing.
Once, again thanks for your time and for the help. I really appreciate it.
Idan
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Fred Jones Sent: Saturday, December 26, 2009 10:34 PM To: support@drupal.org Subject: Re: [support] adding an Onclick setting to jquery drupal settings
I found a tutorial here:
http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con tent
On how to do it with lightbox2. But still with the same result, and this
time just the content part and NOT the entire page.
That's fantastic! The code is working perfectly then. Because that's *exactly* what that tutorial wants to achieve--to load just the content of a node via Ajax.
People here will be happy to provide support with Drupal questions, but I will repeat what I said before--you need to learn how jQuery works. That or find a programmer who understands it. This list, however, is not the place to learn jQuery.
Fred
Hi,
Thanks for the tip, I'm actually able to get only the section I need, the problem is that the js tabs in that page aren't appearing.
I'm following this guide: http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con tent#comment-37 using lightbox2.
this is the code i'm using: <a href="/websites/shooky/node/130/lightbox2" class="ajaxme">test ajax</a> <script type="text/javascript"> $(document).ready(function(){ $("a.ajaxme").click(function(){
var AjaxSRC = $(this).attr("href"); //grabs the href location of the click link; $("#ajaxtarget").empty().load(AjaxSRC + " #ajaxme"); //empties the div and loads in the content; $("#ajaxtarget").ready(Drupal.attachBehaviors); return false; //stops the link action form changing the page });
}); </script> <div id="ajaxtarget"></div>
the section of the page loads, but the tabs and tab content is missing.
i'd appreciate any help. Thanks. -----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Jamie Holly Sent: Sunday, December 27, 2009 12:07 AM To: support@drupal.org Subject: Re: [support] adding an Onclick setting to jquery drupal settings
If you are doing JQuery.load you can put a selector in the URL. That way it will only return the part of the page you want. See this page for details:
http://docs.jquery.com/Ajax/load
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 12/26/2009 3:40 PM, Idan Arbel wrote:
Hi,
Thank you for your assistance, you've been a very helpful and patient and
I
appreciate it. I'll keep on working on my issue of the tabs that aren't appearing.
Once, again thanks for your time and for the help. I really appreciate it.
Idan
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Fred Jones Sent: Saturday, December 26, 2009 10:34 PM To: support@drupal.org Subject: Re: [support] adding an Onclick setting to jquery drupal settings
I found a tutorial here:
http://www.erikhedin.com/web-design/drupal-tips/Easy-Ajax-Nodes-Lightbox-Con
tent
On how to do it with lightbox2. But still with the same result, and
this
time just the content part and NOT the entire page.
That's fantastic! The code is working perfectly then. Because that's *exactly* what that tutorial wants to achieve--to load just the content of a node via Ajax.
People here will be happy to provide support with Drupal questions, but I will repeat what I said before--you need to learn how jQuery works. That or find a programmer who understands it. This list, however, is not the place to learn jQuery.
Fred