如何在jQuery中创建一个div,我可以在

时间:2017-07-04 05:18:37

标签: javascript jquery html css node.js

我正在创建一个电影搜索引擎。到目前为止,当我在输入中键入电影时,我会收到一系列电影,如下面的屏幕截图所示。

The way my movies are shown. I have to scroll down to see more

相反,我希望我的图像的表现方式与Google中的图像相似。

The way google shows its movies. You have to scroll right to see more, but the page remains static, only the movies change as you scroll

希望有人可以提供帮助。提前谢谢!

2 个答案:

答案 0 :(得分:0)

您可以使用css实现它,但如果情况需要JQuery,您可以像下面那样执行

$('#search-container').append(
  $('<div/>')
    .attr("id", "movie")
    .addClass("new-movie")
    .css({"width": "1000px", "overflow-x": "auto"})
);

答案 1 :(得分:0)

&#13;
&#13;
 document.getElementById("content").style.overflowX = "scroll";
document.getElementById("content").style.width = "200px";
&#13;
&#13;
&#13;

在你的js中试试这个。