0

我对 jQuery 灯箱有疑问。在以前的项目中它有效,但在这个项目中它直接显示图片(不是在灯箱框架中,而是直接像我浏览器中的“image.JPG”)。你能

PS('existingid' 是一个真正存在于代码中的 id :))

<!DOCTYPE html>
<html>
    <head>
        <title><?php echo $title; ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta http-equiv="content-language" content="pl"/>
        <meta name="Keywords" content="folky"/>
        <meta name="description" content="FOLKY"/>
        <meta name="robots" content="index,follow,all"/>
        <link rel="stylesheet" type="text/css" href="http://adres.ko/reset.css"/>   
        <link rel="stylesheet" type="text/css" href="http://adres.ko/style.css"/>
        <link rel="Shortcut icon" href="http://adres.ko/image/favicon.ico"/>
        <link rel="stylesheet" type="text/css" href="http://adres.ko/jquery.lightbox-0.5.css"/> 
        <script src='http://adres.ko/js/jquery.lightbox-0.5.js'></script>
        <script src='http://adres.ko/js/jquery.color-RGBa-patch.js'></script>
        <script type='text/javascript' src='http://adres.ko/js/jquery-2.0.2.min.js'></script>
    </head>

    <body>  
        <?php include $_SERVER['DOCUMENT_ROOT'].'/text.php'?>
        <div id="top">
            <div class="white">
                <div class="content">
                    <a href="localhost/"><img class="logo" src="http://adres.ko/image/logo.png"/></a>
                    <?php include($_SERVER['DOCUMENT_ROOT'].'/menu.php')?>
                </div>
            </div>
            <div id="top-bottom">
            </div>
        </div>

和PHP:

<?php $title='Tutke';
$menuclass1="active";
$menuclass2=$menuclass3=$menuclass4="";
include $_SERVER['DOCUMENT_ROOT'].'/header.php';?>

<div id="content">
    <?php include $_SERVER['DOCUMENT_ROOT'].'/menuleft.php'?>

    <div class="offercontent">
        <script type="text/javascript">
    $(function() {
        $('#existingid a').lightBox({fixedNavigation:true});
    });
    </script>

        <?php 
            if(!empty ($_GET['category']))
            {
            $category = $_GET['category'];
            $katalog=$_SERVER['DOCUMENT_ROOT'].'/oferta/'.$category.'/';
                $kat=opendir($katalog);
                $ile=0;
                while($plik=readdir($kat))
                    {
                    if($plik!="." && $plik!="..")
                        {
                        $Lista[]=$plik;
                        }
                    }
                $which=1;
                    echo '<div class="ribbon-big-product"><img class="pink_b_l" src="http://adres.ko/image/pink_b_l.png"/><div class="pink_b_c"><div class="pink_b_text">'
                    .$$category.
                    '</div></div><img class="pink_b_r"src="http://adres.ko/image/pink_b_r.png"/></div>';
                foreach($Lista as $Nazwa)
                {
                    if($which!=1) 
                        {echo '<div class="dots">........................................................................................................................................</div>';};

                    include ('oferta/'.$category.'/'.$Nazwa);

                    echo "<div class='product'><div><div><h1>".$ptitle."</h1>".$ptext."</div>";
                    echo "<div class='gallery' id='".$pid."'>";

                            $kataloga=$_SERVER['DOCUMENT_ROOT'].'/oferta/img/'.$pid."/min/";
                            $kata=opendir($kataloga);
                            while($plika=readdir($kata))
                                {
                                if($plika!="." && $plika!=".." && $plika!="...")
                                    {
                                    $Listaa[]=$plika;
                                    $ile++;
                                    }
                                }
                            foreach($Listaa as $Nazwaa)
                            {
                                if($Nazwaa!="Thumbs.db"){
                                echo "<div><a href='http://adres.ko/oferta/img/".$pid."/".$Nazwaa."'><img src='http://adres.ko/oferta/img/".$pid."/min/".$Nazwaa."' alt=''/></a></div>";}

                            };
                            $Listaa="";
                    echo "</div></div><div><img class='image' src='http://adres.ko/oferta/img/".$pid."/".$pimg."'/></div></div>";

                    $which++;
                };
                ;
            }
            else{
            $katalog=$_SERVER['DOCUMENT_ROOT'].'/oferta/polecane/';
                $kat=opendir($katalog);
                $ile=0;
                while($plik=readdir($kat))
                    {
                    if($plik!="." && $plik!="..")
                        {
                        $Lista[]=$plik;
                        }
                    }
                $which=1;
                    echo '<div class="ribbon-big-product"><img class="pink_b_l" src="http://adres.ko/image/pink_b_l.png"/><div class="pink_b_c"><div class="pink_b_text">POLECANE</div></div><img class="pink_b_r"src="http://adres.ko/image/pink_b_r.png"/></div>';
                foreach($Lista as $Nazwa)
                {
                    if($which!=1) 
                        {echo '<div class="dots">........................................................................................................................................</div>';};

                    include ('oferta/polecane/'.$Nazwa);

                    echo "<div class='product'><div><div><h1>".$ptitle."</h1>".$ptext."</div>";
                    echo "<div class='gallery' id='".$pid."'>";

                            $kataloga=$_SERVER['DOCUMENT_ROOT'].'/oferta/img/'.$pid.'/min/';
                            $kata=opendir($kataloga);
                            while($plika=readdir($kata))
                                {
                                if($plika!="." && $plika!=".." && $plika!="...")
                                    {
                                    $Listaa[]=$plika;
                                    $ile++;
                                    }
                                }
                            foreach($Listaa as $Nazwaa)
                            {
                                if($Nazwaa!="Thumbs.db"){
                                echo "<div><a href='http://adres.ko/oferta/img/".$pid."/".$Nazwaa."'><img src='http://adres.ko/oferta/img/".$pid."/min/".$Nazwaa."' alt=''/></a></div>";}

                            };
                            $Listaa="";
                    echo "</div></div><div><img class='image' src='http://adres.ko/oferta/img/".$pid."/".$pimg."'/></div></div>";

                    $which++;
                };
                ;};
            ?>

    </div>


<?php include $_SERVER['DOCUMENT_ROOT'].'/footer.php'?>

请帮忙

4

2 回答 2

0

问题已解决 - reset.css 阻止了 LightBox 框架

于 2013-06-12T08:53:35.780 回答
0

摆脱脚本包含的顺序(在包含任何其他本身使用 jQuery 的脚本之前包含 jQuery

 <script type='text/javascript' src='http://adres.ko/js/jquery-2.0.2.min.js'></script>
 <script src='http://adres.ko/js/jquery.lightbox-0.5.js'></script>
 <script src='http://adres.ko/js/jquery.color-RGBa-patch.js'></script>
于 2013-06-10T20:54:46.720 回答