通过单击“下一个”按钮将一张图像替换为另一张图像。按钮
这是我的网站: http://mollymasonjohnson.com/project_3/newstyles.html
当您点击“图形设计”时娃娃,它将带您进入平面设计页面。在此页面上有一些缩略图,单击这些缩略图会显示我的项目的图像。其中一些项目涉及多个图像,因此我需要能够单击“下一个”按钮(在本例中为右下角的蓝色小箭头)从项目的一个图像转到下一个图像。
我尝试制作一个数组(从某个项目中的一个图像切换到该项目中的下一个图像),但它对我不起作用。我做错了什么?
Here is my website:
http://mollymasonjohnson.com/project_3/newstyles.html
When you click the "Graphic Design" doll it takes you to the Graphic Design page. On this page there are thumbnails that when clicked bring up images of my projects. Some of these projects involve more than one image, so I need to be able to click a "next" button (in this case the little blue arrow on the bottom right)to go from one image of a project to the next.
I tried making an array (to switch from one image within a certain project to the next image within that project) but it didn't work for me. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先使用百分比而不是幻灯片的固定值。即使用 100% 而不是 -1490px,因为我在大屏幕上查看它并且在幻灯片后仍然可以看到娃娃。
好的,问题是没有包含您选择的 id 的元素。你在gd-project上得到elementbyid,但那是类,元素有id gd-project-1、gd-project-2、gd-project-3等。此外,这是div的id而不是实际图像,所以它没有 src 属性。
尝试类似的东西(因为你有jquery)
希望这有帮助!
First off use percents instead of fixed values for the slide. I.e. use 100% instead of -1490px since I'm looking at it on a large screen and can still see the dolls after the slide.
ok the problem is that there is no element with the id you select. You getelementbyid on gd-project but that is the class and the elements have ids gd-project-1,gd-project-2,gd-project-3, etc. Furthermore that is the id of the div not the actual image so it has no src property.
try something like (since you have jquery)
hope this helps!