Hello.

I'm quite new to JQuery and still finding my feet, but I too am having
issues with the HTMLDivElement object. In my example I have a variable
holding a chunk of html, I can use childNodes, and have indeed managed to
find an image within the html and collect it's .src .

So I thought getting a class value from the parent DIV would be easy. I've
tried slide.attr(class) or checking to see if a specific class is present
slide.hasClass("hori"); , both to no avail. I know I'm not interpretting the
DOM manipulation right, and if anyone has a starting points that'd be
greatly appreciated.

I'm using http://malsup.com/jquery/cycle/ , and this is the bit of code
that's tripping me up:

<script type="text/javascript">
$(function() {
    $('#imageContent').cycle({
        fx:     'fade',
        speed:  800,
        timeout: 5000,
        pager:  '#imageNavigation',
        
                
                pagerAnchorBuilder: function(idx, slide) {

                
                        /* At this point I want to see the class of the DIV 
contained within the
slide object 
                        So I can tweak how the generated thumbnails are
displayed */
                
                        var childNodeArray = slide.childNodes;
                        var selectedNode;
                        if (childNodeArray[0].src) {selectedNode = 
childNodeArray[0].src} else
{selectedNode = childNodeArray[1].src}
            return '<li> #  ' + selectedNode + '  </li>';
        }
    });
});
</script>

To help clarify, this is the html contained within the slide variable :
<div class="hori">
      img1.jpg 
     <p>Image Caption</p>
</div>


Regards,
Meeesta
-- 
View this message in context: 
http://old.nabble.com/Tabs%2C--ui.panel-and-HTMLDivElement%2C-tp21747828s27240p26370494.html
Sent from the jQuery UI Discussion mailing list archive at Nabble.com.

--

You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=.


Reply via email to