add button for theater RWD

This commit is contained in:
jason 2019-01-17 09:52:34 +08:00
parent 0af824527b
commit c2637fc346
2 changed files with 55 additions and 0 deletions

View File

@ -47,6 +47,27 @@ var GalleryTheater = function(){
var id = window.location.hash.split("#")[1];
gt.createTheater("/xhr/galleries/theater/" + id);
}
var addButton = function () {
$('.theaterButton').remove();
$('<button id ="theaterPreviousButton" class="theaterButton">' + '<' + ' </button> <button id ="theaterNextButton" class="theaterButton">' + '>' + ' </button>').insertAfter($('img.gal-active'));
if (!$(".gal-prev").length) { $('#theaterPreviousButton').remove(); }
if (!$(".gal-next").length) { $('#theaterNextButton').remove(); }
$('#theaterPreviousButton').click(function () {
gt.previousPic();
});
$('#theaterNextButton').click(function () {
gt.nextPic();
});
}
addButton();
function locationHashChanged() {
addButton();
}
window.onhashchange = locationHashChanged;
}
var bindHandler = function(){

View File

@ -455,3 +455,37 @@ body {
bottom: 0;
}
}
/* CSS for button */
@media(max-width: 769px){
.gallery .gallery-thumb-toggle{
display: none;
}
}
/* 相本裡的左右控制鍵 */
.theaterButton{
position: absolute;
text-align: center;
width: 45%;
bottom: 50px;
background-color: transparent;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 2.2rem;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
}
#theaterNextButton{
right:0;
}
#theaterPreviousButton{
left:0;
}