我无法在我的网站上显示产品的详细信息

时间:2018-02-14 09:35:19

标签: javascript php css

当我点击产品时,我希望图像放大并显示产品的详细信息。扩大图像是有效的,但我无法获得产品的详细信息。

这是我的代码:

<script type="text/javascript">
    $(function($){
        var addToAll = false;
        var gallery = true;
        var titlePosition = 'inside';
        $(addToAll ? 'img' : 'img.fancybox').each(function(){
            var $this = $(this);
            var title = $this.attr('title');
            var src = $this.attr('data-big') || $this.attr('src');
            var a = $('<a href="#" class="fancybox"></a>').attr('href', src).attr('title', title);
            $this.wrap(a);
        });
        if (gallery)
            $('a.fancybox').attr('rel', 'fancyboxgallery');
        $('a.fancybox').fancybox({
            titlePosition: titlePosition
        });
    });
    $.noConflict();
</script>

花哨的盒子

<div class="fancybox" align="center">
<?php
require_once("admin/config/connection.php");
$proname   = "";
$proitems  = "";
$pid       = "";
$query1    = "select * from products where protype='Bicycle/ Tricycle'";
$resource1 = mysql_query($query1, $connection);
$result1   = "";
$id        = "";
while ($record = mysql_fetch_array($resource1)) {
    $pid     = $record['pid'];
    $img     = "uploads/" . $record['proimg'];
    $proname = $record['proname'];
    //$proitems=$record['proitem'];
    $result1 .= "<div class='col-lg-4 col-md-4 col-sm-4 col-xs-12 mrgn_less prd'>
              <img class='fancybox' src='$img' >

      </div>";
}
?>

2 个答案:

答案 0 :(得分:0)

你没有回应你必须在while循环之后做的结果。把它放在while循环之后。

<script type="application/javascript"> function saveAllCellsBeforeSubmit() { for (var widgetName in PrimeFaces.widgets) { if (PrimeFaces.widgets[widgetName].hasOwnProperty('cfg') &amp;&amp; PrimeFaces.widgets[widgetName].cfg.hasOwnProperty('editMode') &amp;&amp; PrimeFaces.widgets[widgetName].cfg.editMode === 'cell') { var d = PF(widgetName); var c = d.jq.find('td:has(.ui-cell-editor-input:visible)'); if (c.length) { d.saveCell(c); } } } } </script>

答案 1 :(得分:0)

foreach(var value in Enum.GetValues(typeof(TypeofEmp)))
{
    Console.WriteLine($"{(TypeofEmp)value} (integer value: {(int)value})");
}

// output:
Admin (integer value: 1)
HttpRequest (integer value: 2)
Devoloper (integer value: 3)