Accessing the current image object

william's Avatar

william

23 Aug, 2012 11:34 PM

Hi Dmitri,

Is there a simple way to get to the current underlying image object?

I'd like to try the stackBlur effect with an pane I'm going to overlay across the slider (in full-screen mode).

Thanks,
William.

  1. Support Staff 1 Posted by Dmitry Semenov on 24 Aug, 2012 09:21 AM

    Dmitry Semenov's Avatar

    Hi,

    currSlide.holder holds current slide jQuery html element.

    jQuery('.royalSlider').data('royalSlider').currSlide.holder.find('img')
    

    Dmitry

  2. 2 Posted by william on 24 Aug, 2012 01:43 PM

    william's Avatar

    Thanks Dmitry,

    I had to get to the underlying img object using...

    sliderInstance.currSlide.holder.find('img')[0]

    But now it works fine.

    Thanks, W.;

  3. william closed this discussion on 24 Aug, 2012 01:44 PM.

  4. william re-opened this discussion on 24 Aug, 2012 04:17 PM

  5. 3 Posted by william on 24 Aug, 2012 04:17 PM

    william's Avatar

    Ah, so... prematurely closed. I need to understand a little more - I forgot about scaling.

    Is there a clean way to get the x and y offset within the source image returned using the code snip above as displayed by the slider? And also the height and width of the piece of the image shown. (I'll be using drawImage() with a canvas context object and need to offset and scale the source into the pop-up).

    I've tried going through the dev file, but it's a lot to assimilate quickly.

    Thanks, W.

  6. Support Staff 4 Posted by Dmitry Semenov on 24 Aug, 2012 04:27 PM

    Dmitry Semenov's Avatar

    Here is function that resizes image - https://skitch.com/diiiimaaaa/equxe/jquery.royalslider.js-new-royal...

    You may also just get dimensions and margin of image via jQuery.

    Dmitry

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac