Tag Archives: js

Puh.. not my thing

OK, here is something to laugh :
I start with a jQuery plugin and study the plugin jCarousel . I’m at the moment not able to understand and to use the real basics from jQuery. I configure an array of pictures (this.imgarray) and would like to wrap around a link and some div’s. This is the first result :


// get to start point 
this.container = this.list.parent();
        
for (var i = 0; i < this.imgarray.length; i++) {

   this.innerHTML = &#039;<a href="'+ this.imgarray&#91;i&#93;&#91;0&#93; +'">';
   this.innerHTML += '<img />';
   this.innerHTML += '</a></div>';
        
   this.container = this.list.append(this.innerHTML).children();

}

// add the div container
this.container.wrap('<div class="ngg-gallery-thumbnail-box"></div>');
this.container.wrap('<div class="ngg-gallery-thumbnail"></div>');  

Here the result :

HTML result

Mhh, It’s ok , but  I think it’s the wrong method or to complicated. Could be easier at least… need more time to learn jQuery 😦

Advertisements
Tagged , , ,