x
x
x
x
...
ConfiForms Form Definition | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
HTML |
---|
<div id="admin-panel">
<a href="#cf_messages" id="toggle-admin-table">Manage Announcements</a>
</div>
<script>
$( "#toggle-admin-table" ).click(function() {
if($('.announcementsTable').is(":visible")){
$('.announcementsTable').hide()
}
else{
$('.announcementsTable').show()
}
});
let adminPanel = document.getElementById('admin-panel')
let addAnouncement = $('button.aui-button.aui-button-primary.cf_dashboardannouncementspremium')[0]
adminPanel.insertAdjacentElement('afterbegin',addAnouncement)
</script> |
Divbox | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
HTML |
---|
<!-- End admin section --> |
HTML |
---|
<!-- Start id=announcements-wrapper section --> |
HTML |
---|
<p class="header">About the Innovation Awards</p>
<div class="carousel-container">
<span class="carousel-arrow carousel-previous">◀</span> |
ConfiForms CleanView | ||||
---|---|---|---|---|
| ||||
HTML |
---|
<span class="carousel-arrow carousel-next">▶</span>
</div>
<script>
let anouncementNo = document.getElementsByClassName("announcementcard").length
if(anouncementNo < 2){
$('.carousel-next').hide()
$('.carousel-previous').hide()
}
$('.carousel-previous').click(function() {
if(slideIndex -1 === 0){
currentSlide(anouncementNo)
}
else{
currentSlide(slideIndex - 1)
}
});
$('.carousel-next').click(function() {
if(slideIndex + 1 > anouncementNo){
currentSlide(1)
}
else{
currentSlide(slideIndex + 1)
}
});
let div = document.getElementsByClassName('carousel-container')[0]
div.addEventListener('touchstart', handleTouchStart, false);
div.addEventListener('touchmove', handleTouchMove, false);
var xDown = null;
var yDown = null;
function getTouches(evt) {
return evt.touches || // browser API
evt.originalEvent.touches; // jQuery
}
function handleTouchStart(evt) {
console.log('touched')
const firstTouch = getTouches(evt)[0];
xDown = firstTouch.clientX;
yDown = firstTouch.clientY;
};
function handleTouchMove(evt) {
if ( ! xDown || ! yDown ) {
return;
}
var xUp = evt.touches[0].clientX;
var yUp = evt.touches[0].clientY;
var xDiff = xDown - xUp;
var yDiff = yDown - yUp;
if ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {/*most significant*/
if ( xDiff > 0 ) {
/* left swipe */
console.log('swiped left')
if(slideIndex + 1 > anouncementNo){
currentSlide(1)
}
else{
currentSlide(slideIndex + 1)
}
} else {
/* right swipe */
console.log('swiped right')
if(slideIndex -1 === 0){
currentSlide(anouncementNo)
}
else{
currentSlide(slideIndex - 1)
}
}
} else {
if ( yDiff > 0 ) {
/* up swipe */
console.log('swiped up')
} else {
/* down swipe */
console.log('swiped down')
}
}
/* reset values */
xDown = null;
yDown = null;
};</script> |
HTML |
---|
<!-- End adminid=announcements-wrapper section --> |
HTML |
---|
<!-- End id=announcementcontainer section --> |
...