小编Tra*_*ere的帖子

添加选择下拉框以点击交换图像js

我有一个javascript,当你点击图像时它会改变图像scr,它将循环通过.它还有箭头键盘导航的分页链接.我想要做的是添加一个选择下拉列表框,允许我跳转到我想要的任何图像.我怎样才能做到这一点?我只想要一个没有提交按钮的选择下拉列表

/* set first image in frame from #shoebox on document.ready */
$(function() {
  var leadOff = $('#shoebox img:first-child').attr('source');
	$('.picture').attr({'src' : leadOff, 'imageposition' : '1'});
});
/* load next image from #shoebox (click on image and/or next button) */
$('#pictureframe, #buttonright').click(function() {
  var imageTally = $('#shoebox img').length;
	var imagePosition = $('.picture').attr('imageposition');
  var plusOne = parseInt(imagePosition) + 1;
  var nextUp = $('#shoebox img:nth-child(' + plusOne + ')').attr('source');
  if (imagePosition == imageTally) {
    var leadOff = $('#shoebox img:first-child').attr('source');
    $('.picture').attr({'src' : leadOff, 'imageposition' …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery drop-down-menu

5
推荐指数
1
解决办法
201
查看次数

如何在页面上垂直居中div?

如何将#box div垂直居中在页面中心?我试过vertical-align:middle; 但它不起作用.你可以在这里查看网站

这是css:

iframe {
  position: fixed;  
  width: 100vw; 
  height: 100vh;  
  border: none; 
  margin: 0; 
  padding: 0; 
  overflow: hidden; 
  z-index: 999999;
}

body {
  background-color: #000;
}

#box {
  text-align: center;
  vertical-align: middle;
}

#link {
  color: #FFF;
}

#download {
  color: #FFF;
}
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

html ×2

css ×1

drop-down-menu ×1

javascript ×1

jquery ×1