For Rent
3 Bedrooms | 2 Bathrooms | 2 Reserved Parking Spaces
3 bedrooms ensuite + Study nook1 secure and one outdoor…Read More→
Resort Lifestyle Here !
Two storeyTwo BedroomsUse of pool. Communal BBQ and outdoor gym.Functional…Read More→
Open Spacious Living Areas
2 Bedrooms2 living areas2 secure parking spacesDouble-glazed windowsReverse cycle air…Read More→
Live were its Fun !
1 Bedroom + parking and storageSecurity and lift storageClose to…Read More→
var initPhotoSwipeFromDOM = function (gallerySelector) { var parseThumbnailElements = function (el) { console.log(el); var thumbElements = $(el).closest(main_gallery).find('figure'), numNodes = thumbElements.length, items = [], figureEl, linkEl, size, item;
for (var i = 0; i < numNodes; i++) {
figureEl = thumbElements[i]; //
// include only element nodes if (figureEl.nodeType !== 1) { continue; }
linkEl = figureEl.children[0]; // element
size = linkEl.getAttribute('data-size').split('x');
// create slide object item = { src: linkEl.getAttribute('href'), w: parseInt(size[0], 10), h: parseInt(size[1], 10) };
if (figureEl.children.length > 1) {
//
if (linkEl.children.length > 0) {
// thumbnail element, retrieving thumbnail url
item.msrc = linkEl.children[0].getAttribute('src');
}
item.el = figureEl; // save link to element for getThumbBoundsFn items.push(item); }
return items; };
// find nearest parent element var closest = function closest(el, fn) { return el && (fn(el) ? el : closest(el.parentNode, fn)); };
// triggers when user clicks on thumbnail var onThumbnailsClick = function (e) { e = e || window.event; e.preventDefault ? e.preventDefault() : e.returnValue = false;
var eTarget = e.target || e.srcElement;
// find root element of slide var clickedListItem = closest(eTarget, function (el) { return (el.tagName && el.tagName.toUpperCase() === 'FIGURE'); });
if (!clickedListItem) { return; } var clickedGallery = clickedListItem.parentNode, childNodes = $(clickedListItem).closest(main_gallery).find('figure'), numChildNodes = childNodes.length, nodeIndex = 0, index;
for (var i = 0; i < numChildNodes; i++) { if (childNodes[i].nodeType !== 1) { continue; } if (childNodes[i] === clickedListItem) { index = nodeIndex; break; } nodeIndex++; } if (index >= 0) { // open PhotoSwipe if valid index found openPhotoSwipe(index, clickedGallery); } return false; };
var openPhotoSwipe = function (index, galleryElement, disableAnimation) { var pswpElement = document.querySelectorAll('.pswp')[0], gallery, options, items;
items = parseThumbnailElements(galleryElement);
// define options (if needed) options = { history: false, bgOpacity: 0.8, loop: false, barsSize: { top: 0, bottom: 'auto' },
// define gallery index (for URL) galleryUID: $(galleryElement).closest(main_gallery).attr('data-pswp-uid'),
getThumbBoundsFn: function (index) { // See Options -> getThumbBoundsFn section of documentation for more info var thumbnail = document.querySelectorAll(main_gallery + ' img')[index], //var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail pageYScroll = window.pageYOffset || document.documentElement.scrollTop, rect = thumbnail.getBoundingClientRect();
return { x: rect.left, y: rect.top + pageYScroll, w: rect.width }; }
};
options.index = parseInt(index, 10);
// exit if index not found if (isNaN(options.index)) { return; }
if (disableAnimation) { options.showAnimationDuration = 0; }
// Pass data to PhotoSwipe and initialize it gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
gallery.listen('gettingData', (index, item) => { if (!item.w || !item.h) { const innerImgEl = item.el.getElementsByTagName('img')[0] if (innerImgEl) { item.w = innerImgEl.width; item.h = innerImgEl.height; }
const img = new Image() img.onload = function () { //item.w = this.width; //item.h = this.height;
var viewportWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); var viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var aspectRatio = this.width / this.height; var viewportRatio = viewportWidth / viewportHeight; var adaptedHeight = this.height; var adaptedWidth = this.width;
if (viewportRatio > aspectRatio) // scale by width or height? { adaptedHeight *= viewportWidth / this.width; adaptedWidth *= viewportWidth / this.width; } else { adaptedHeight *= viewportHeight / this.height; adaptedWidth *= viewportHeight / this.height; }
item.w = adaptedWidth; item.h = adaptedHeight;
gallery.updateSize(true) } img.src = item.src } });
gallery.init(); //gallery.shout('helloWorld', 'John' /* you may pass more arguments */);
var totalItems = gallery.options.getNumItemsFn();
function syncPhotoSwipeWithOwl() { var currentIndex = gallery.getCurrentIndex(); galleryTop.slideTo(currentIndex); if (currentIndex == (totalItems - 1)) { $('.pswp__button--arrow--right').attr('disabled', 'disabled').addClass('disabled'); } else { $('.pswp__button--arrow--right').removeAttr('disabled'); } if (currentIndex == 0) { $('.pswp__button--arrow--left').attr('disabled', 'disabled').addClass('disabled'); } else { $('.pswp__button--arrow--left').removeAttr('disabled'); } }; gallery.listen('afterChange', function () { syncPhotoSwipeWithOwl(); }); syncPhotoSwipeWithOwl(); };
// loop through all gallery elements and bind events var galleryElements = document.querySelectorAll(gallerySelector);
for (var i = 0, l = galleryElements.length; i < l; i++) { galleryElements[i].setAttribute('data-pswp-uid', i + 1); galleryElements[i].onclick = onThumbnailsClick; } }; var main_gallery = '.gallery-top'; jQuery(document).ready(function() { var galleryTop = new Swiper(main_gallery, { autoHeight: true, spaceBetween: 10, lazy: { loadPrevNext: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', } , on: { init: function () { initPhotoSwipeFromDOM(main_gallery); }, } }); var galleryThumbs = new Swiper('.gallery-thumbs', { autoHeight: true, spaceBetween: 10, centeredSlides: true, slidesPerView: 5, touchRatio: 0.2, slideToClickedSlide: true, }); galleryTop.controller.control = galleryThumbs; galleryThumbs.controller.control = galleryTop; }); function SlideToFloorplans(index) { galleryTop.slideTo(index); scrollToAnchor('photos'); } function scrollToAnchor(aid) { var aTag = $("a[name='" + aid + "']"); $('html,body').animate({ scrollTop: aTag.offset().top - $("nav").height() }, 'slow'); }
jQuery(function($) {
$("#myBtn").click(function() { $("#myModal").fadeIn(); });
$("button.close, button.btn-cancel").click(function() { $("#myModal").fadeOut(); });
$(document).on('click', '#myModal', function(e) { if ($(e.target).is('#myModal') || $(e.target).is('.modal-dialog')) { $("#myModal").fadeOut(); } });
});