gpt4 book ai didi

javascript - 滚动条到水平 div

转载 作者:行者123 更新时间:2023-11-28 03:03:47 25 4
gpt4 key购买 nike

我有一个 CSGO Gamble 网站,我希望 pot 中的当前元素显示在带有滚动条的水平 div 中,我所做的就是

enter image description here

代码如下:

<?php
@include_once('set.php');
@include_once('steamauth/steamauth.php');
@include_once "langdoc.php";
$lang = $_COOKIE["lang"];

$gamenum = fetchinfo("value","info","name","current_game");
if(!isset($_SESSION["steamid"])) $admin = 0;
else $admin = fetchinfo("admin","users","steamid",$_SESSION["steamid"]);
$ls2=0;
//$rs69 = mysql_query("SELECT * FROM `game".$gamenum."` GROUP BY `userid` ORDER BY `id` DESC");
$rs69 = mysql_query("SELECT * FROM `game25` GROUP BY `userid` ORDER BY `id` DESC");?>
<?php if(mysql_num_rows($rs69) == 0): ?>
<?php else: ?>
<?php $row69 = mysql_fetch_array($rs69); ?>
<?php
if(!empty($row69['userid'])):
$ls2++;
$avatar = $row69["avatar"];
$userid = $row69["userid"];
$username = fetchinfo("name", "users", "steamid", $userid);
$usn = '"item" title="'.$username.'"';
$steamid = fetchinfo("steamid", "users", "steamid", $userid);
$rs2 = mysql_query("SELECT SUM(value) AS value FROM `game".$gamenum."` WHERE `userid`='$userid'");
$row = mysql_fetch_assoc($rs2);
$sumvalue = $row69["value"];
?>

<?php //item stuff
//$rs322=mysql_query("SELECT * FROM `game".$gamenum."` WHERE `userid`='$userid' ORDER BY `value` DESC ");
//$rs322=mysql_query("SELECT * FROM `game25` ORDER BY `value` DESC ");
$rs322=mysql_query("SELECT * FROM `game".$gamenum."` ORDER BY `value` DESC ");
while ($row699 = mysql_fetch_array($rs322)):
$imglnk = 'http://steamcommunity-a.akamaihd.net/economy/image/'.$row699["image"].'/70fx58f';
$wepprice = $row699['value'];
$weppname = $row699['item'];
$height="0";
$ipx="px;";
$heipx = $height.' '.$ipx;
?>
<div class = "itemsdrop">
<div class ="dropitems">
<img src=<?php echo $imglnk; ?> class="mCS_img_loaded">
</div>
<div class="col-lg-11 desc">
<span class ="number hide"></span>
</div>
</div>
</div>
<?php $height = $height + "15"; ?>
<?php
endwhile;
endif; //end if(!empty...)
endif;

?>

CSS:

.itemsdrop {
background:#fff;
float:left;
position:relative;
}

.dropitems {
overflow:hidden;
overflow-x:scroll;
}

有人能帮帮我吗?让它工作会很好。

最佳答案

Here's水平滚动的简单示例。

基本上,您需要将以下属性分配给外部 (parent) 元素(在您的情况下,我认为它是 .itemsdrop):

white-space: nowrap;
overflow-x: scroll;

这将允许内部元素水平滚动。

您的代码的问题是您要向每个框而不是父元素添加水平滚动条。

关于javascript - 滚动条到水平 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33466636/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com