asp.net创建图库的问题 [英] asp.net problem in creating an image gallery

查看:66
本文介绍了asp.net创建图库的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在asp.net中使用jquery在这里创建一个图库是代码

< script type =   text / javascript> 
$( document )。ready( function (){
$(< span class =code-string> 。thumbnail)。click( function (){
var address = $( .Bigimage)。attr( src);
$ ( #popup)。fadeIn( slow
$( #lightbox)。attr( src,address);

});
$( #popup)。click( function (){
$( #popup)。fadeOut( fast);
});
});
< / script>



这是asp.net代码

< div style =   background:#e7e5e5; height:674px; >  
< img src = 汽车缩略图/雪佛兰缩略图/ 03_chevrolet_sail_u_va_caviar_black.png class = thumbnail title = 梅赛德斯 - 奔驰SLK55 AMG />
< img src = cars%20thumbnails / Chevrolet%20thumbnail / 2014-Chevrolet-Impala-LTZ- side.png class = thumbnail />
< img src = cars%20thumbnails / Chevrolet%20thumbnail / 2014-chevrolet-impala-navy- rear-left-angle.png class = 缩略图 />
< / div >
< / div >
< div id = popup >
< div id = center style = border:hidden; >
< img src = car images / chevrolet / 03_chevrolet_sail_u_va_caviar_black.jpg < span class =code-keyword> class = Bigimage style = height:550px; width:600px; />
< img src = 汽车图片/雪佛兰/ 2014-Chevrolet-Impala-LTZ-side.jpg class = Bigimage style = height:550px; width:600px; />
< img id = lightbox src = upcomming_Cars / Mercedes-Benz SLK55 AMG.PNG />

< / div > < / div >



这是我的asp.net图像现在我面临的问题是我的第一个缩略图及其相关的大图正在正常打开但是当我点击下一张图片当我点击第一张图片时,同一张图片就会打开。请尽快帮助我

解决方案

文档)。ready( function (){


。thumbnail)。click( function (){
var address =


.Bigimage)。attr( src );

i m trying to create an image gallery in asp.net using jquery here is the code

<script type="text/javascript">
        $(document).ready(function () {
            $(".thumbnail").click(function () {
                var address = $(".Bigimage").attr("src");
                $("#popup").fadeIn("slow")
                $("#lightbox").attr("src", address);
                
            });
            $("#popup").click(function () {
                $("#popup").fadeOut("fast");
            });
        });
    </script>


and this is asp.net code

<div style="background:#e7e5e5; height: 674px;" >
        <img src="cars thumbnails/Chevrolet thumbnail/03_chevrolet_sail_u_va_caviar_black.png" class="thumbnail"   title="Mercedes-Benz SLK55 AMG" />
    <img src="cars%20thumbnails/Chevrolet%20thumbnail/2014-Chevrolet-Impala-LTZ-side.png" class="thumbnail"   /> 
    <img src="cars%20thumbnails/Chevrolet%20thumbnail/2014-chevrolet-impala-navy-rear-left-angle.png" class="thumbnail"   />
   </div>
    </div>
    <div id="popup">
        <div id="center" style="border:hidden;">
            <img  src="car images/chevrolet/03_chevrolet_sail_u_va_caviar_black.jpg" class="Bigimage" style="height:550px; width:600px;"/>
            <img src="car images/chevrolet/2014-Chevrolet-Impala-LTZ-side.jpg"  class="Bigimage" style="height:550px; width:600px;" />
        <img id="lightbox" src="upcomming_Cars/Mercedes-Benz SLK55 AMG.PNG" />
       
                    </div></div>


this is my asp.net image now the problem i m facing is my first thumbnail and its related big image is getting open properly but when i click on the next image the same image opens when i click on the 1st image plz do help me as soon as you can

解决方案

(document).ready(function () {


(".thumbnail").click(function () { var address =


(".Bigimage").attr("src");


这篇关于asp.net创建图库的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆