English 中文(简体)
我如何利用“ j”或“ Java”在另一个tag子内cap子?
原标题:How do I encapsulate a tag within another tag using jQuery or JavaScript?

我有一个集装箱<代码>div,其中包含一些<代码>img标签。 当我点击<代码>img tag时,我回来的是img tag在<代码>div内的位置。 我愿在另一个<代码>div的标签上填写img,标签要么使用j Query,要么使用Javagust---是否有办法这样做?

我在工作时看到了大图像的umb子,在点击ththth时,我只想显示目前幻灯正在显示的arrow,在探索与粉碎物同时出现的js文档之后,发现它们使用纯 j。

目前,我正在使用这一法典。

    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)
        }
    }
最佳回答

页: 1

$("img").click(function(){
        $(this).wrap("<div />");
});
问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签