I have a container div that contains some img tags. When I click on a img tag, it returns me the index position of that img tag within the div tag. I would like to wrap this img tag within another div tag either using jQuery or JavaScript — is there any way to do this?
I am Working With a WordPress plugin (the Slide show gallery) which displays the thumbnails of large images on clicking the thumnail i want to show a arrow that shows which current slide is beiging displaying.. after exploring the js files that comes along with plugin found that they are using pure javascript.
Currently i am using this code.
for(i;i<this.l;i++){
this.a[i]={};
var h=m[i], a=this.a[i];
a.t= tag('h3',h)[0].innerHTML;
a.d= tag('p',h)[0].innerHTML;
a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
a.p= tag('span',h)[0].innerHTML;
if(this.thumbs){
var g = tag('img',h)[0];
this.p.appendChild(g);
w+=parseInt(g.offsetWidth);
if(i!=this.l-1){
g.style.marginRight=this.spacing+'px';
w+=this.spacing
}
this.p.style.width=w+'px';
g.style.opacity=this.thumbOpacity/100;
g.style.filter='alpha(opacity='+this.thumbOpacity+')';
g.onmouseover=new Function('TINY.alpha.set(this,100,5)');
g.onmouseout=new Function('TINY.alpha.set(this,'+this.thumbOpacity+',5)');
g.onclick=new Function(this.n+'.pr('+i+',1)');
//g.onclick = new Function(this.n)
}
}
you can use .wrap()