i'm new on laravel,
i use elevatezoom in my gallery image. when i change photo, the photo change but elevatezoom show first image. how can i sove this problem.
my html code is here
<div class="col-md-10" id="product-gallery-image" style="float: left">
<img class="mainimage" id="zoom-product" src="{{url($product->thumbnail)}}"
data-zoom-image="{{url($product->img)}}" style="max-width: 100%">
</div>
<div class="col-md-2" style="float: right;padding: 0" id="product_galery">
<ul class="gallery-ul">
<li data-image="{{url($product->thumbnail)}}" data-main-image="{{url($product->img)}}">
<img src="{{url($product->thumbnail)}}"
style="width: 100%">
</li>
<li data-image="{{url($product->thumbnail1)}}" data-main-image="{{url($product->img1)}}">
<img style="max-width: 100%"
src="{{url($product->thumbnail1)}}">
</li>
<li data-image="{{url($product->thumbnail2)}}" data-main-image="{{url($product->img2)}}">
<img style="max-width: 100%"
src="{{url($product->thumbnail2)}}">
</li>
</ul>
</div>
and jquery codes are here,
<script>
var productgalery = $('#product_galery');
var subnailproductgalery = productgalery.find('.gallery-ul li');
subnailproductgalery.click(function () {
var index = $(this).index();
var mainimageurl = $(this).attr('data-main-image');
var thumbimageurl = $(this).attr('data-image');
$('.gallery-ul li').removeClass('activeli');
$(this).addClass('activeli');
showgallery(mainimageurl, thumbimageurl);
})
function showgallery(imageurl, thumb) {
var productgalleryimage = $('#product-gallery-image');
productgalleryimage.find('.mainimage')
.attr('src', thumb)
.attr('data-zoom-image', imageurl)
.elevateZoom();
}
$('#zoom-product').elevateZoom({
'zoomWindowOffetx': -880,
'zoomWindowWidth': 500,
});
Related
I'm having trouble on getting the video to pause after my modal closes. I'm not an expert on javascript, although I understand enough to mess with it and tweak it to my needs.
I'm not sure where to put the new code to pause it once the user clicks the X button...
Can someone help me out? Thanks!
CODE:
<div class="dcontainer">
<div class="dhex">
<div class="dshape"></div>
</div>
<b>Walter</b></div>
<div class="orgchattitlehead">Head</div>
<button id="myBtnWalter"></button>
<div id="myModalWalter" class="modalWalter">
<div class="modal-contentWalter" style="text-align: left;">
<div class="title" style="text-align: left;">
<span style="font-size: 14pt;"><b><span style="font-size: 18pt;">Walter</span><br /></b></span><span style="font-size: 14pt;">2009 <br /></span><span style="font-size: 14pt;">University</span> <br /><span style="font-size: 14pt;"><br /></span>
<span class="closeWalter">×</span></div>
</div>
<div class="aboutvid" style="text-align: left;"><iframe width="374" height="210" src="https:///app/detail/video/8178476/embed" id="aboutvid" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
<script>
var modalWalter = document.getElementById("myModalWalter");
var btn = document.getElementById("myBtnWalter");
var span = document.getElementsByClassName("closeWalter")[0];
btn.onmouseover= function() {
modalWalter.style.display = "block";
}
span.onclick = function() {
modalWalter.style.display = "none";
}
</script>
</div>
</div>
I am displaying multiple webview contents using Electron Js.
part of index.html
<div class="contentArea">
<div id="mySidebar" class="leftMenu">
<ul id="myTab" class="nav nav-tabs">
<li class="nav-item">
Tab1
</li>
<li class="nav-item">
Tab2
</li>
<li class="nav-item">
Tab3
</li>
</ul>
</div>
<div class="contentPages tab-content">
<div class="tab-pane show active" id="webview1">
<webview src="link1" style="width:100%; height:100%" disablewebsecurity allowpopups></webview>
</div>
<div class="tab-pane" id="webview2">
<webview src="link2" style="width:100%; height:100%" disablewebsecurity allowpopups></webview>
</div>
<div class="tab-pane" id="webview3">
<webview src="link3" style="width:100%; height:100%" disablewebsecurity allowpopups></webview>
</div>
<script>
$(document).ready(function () {
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var activeTab = $(e.target).text(); // Get the name of active tab
var previousTab = $(e.relatedTarget).text(); // Get the name of previous tab
$(".active-tab span").html(activeTab);
$(".previous-tab span").html(previousTab);
});
});
</script>
</div>
</div>
I used bootstrap and jquery for design.
Navigation between webviews works very nicely with jquery.
I'm trying to do. Creating forward, backward and refresh buttons for each webview.
It's like an internet browser.
I didn't manage to use the codes properly in ElectronJS.
Can anyone who knows about this please help?
It's Work.
$(document).on( 'click', '#back-button-id', function(){
if(webview-id.canGoToOffset(-1)){
webview-id.goBack();
} });
$(document).on( 'click', '#next-button-id', function(){
if(webview-id.canGoToOffset(+1)){
webview-id.goForward();
} });
How to make the product be added to cookies when clicked on "ADD TO CART", and again removed when clicked? ASP.NET
#{ foreach (var product in Model)
{
<div class="col pb-20 pt-10">
<div class="ee-product">
<div class="image">
<a href="/Electronics/SingleProduct" class="img">
<img src="#Url.Action("GetImage", "Admin", new { productId = product.Id })" width="120" height="300" />
</a>
<a href="" class="add-to-cart">
<i class="ti-shopping-cart"></i><span>ADD TO CART</span>
</a>
</div>
</div>
</div>
The template i'm using doesn't allow scrolling on load. You can only touch scroll after you have selected a collapsed menu item. Once you scroll back to the top it "locks" again (so-to-speak).
The main area that seems to be unscrollable is a slider. Can anyone tell me what I need to do to make this site be scrollable on load?
Any information is greatly appreciated.
The site is here... http://www.slicemfg.com
<div id="home">
<div class="tp-banner-container">
<div class="tp-banner" >
<ul>
<!-- THE FIRST SLIDE -->
<li data-transition="zoomout" data-slotamount="4" data-masterspeed="700">
<img src="images/1.jpg" alt="" /> }
<!-- THE CAPTIONS IN THIS SLIDE -->
<div class="caption big-text lft"
data-x="center"
data-y="350"
width="10px"
data-speed="700"
data-start="700"
data-easing="easeOutExpo">
<div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
<li data-transition="zoomout" data-slotamount="1" data-masterspeed="700">
<img src="images/14.jpg" alt="" />
<div class="just_pattern"></div>
<div class="caption big-text lft"
data-x="center"
data-y="center"
data-speed="700"
data-start="700"
data-easing="easeOutExpo"><div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
<li data-transition="zoomout" data-slotamount="1" data-masterspeed="700">
<img src="images/07.jpg" alt="" />
<div class="just_pattern"></div>
<div class="caption big-text lft"
data-x="center"
data-y="center"
data-speed="700"
data-start="700"
data-easing="easeOutExpo"><div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
<li data-transition="zoomout" data-slotamount="1" data-masterspeed="700">
<img src="images/04.jpg" alt="" />
<div class="just_pattern"></div>
<div class="caption big-text lft"
data-x="center"
data-y="center"
data-speed="500"
data-start="500"
data-easing="easeOutExpo"><div class="big-text"><span4>YOUR IDEAS REALIZED</span4></br><div><a class="button3 scroll" href="#contact">CONTACT US</a></div></div>
</div>
</li>
</ul>
</div>
</div>
</div>
To fix this issue, you need to add touchenabled:"off", to your revolution config.
Your config should now look like this:
(function($) { "use strict";
var revapi;
jQuery(document).ready(function() {
revapi = jQuery('.tp-banner').revolution(
{
delay:5000,
startwidth:2000,
startheight:500,
soloArrowRightVOffset:50,
soloArrowLeftVOffset:50,
hideThumbs:0,
onHoverStop:"off",
navigationType: "none",
fullWidth:"off",
fullScreen:"on",
fullScreenOffsetContainer: "",
touchenabled:"off" //Disable touch events.
});
}); //ready
})(jQuery);
I am trying to implement a navbar for my application whose front end is built using Vue 2.0 and Bulma . It works well on desktops and but on smaller screens its showing the burger icon but it is not showing any elements. Its just present.
<template>
<div class="container is-fluid">
<div>
<nav class="navbar is-dark">
<div class="navbar-brand">
<a class="navbar-item" href="#">
<img alt="K R O N O S" height="100px">
</a>
<div class="button navbar-burger" data-target="navMenu">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div class="navbar-menu" id="navMenu">
<div class="navbar-end">
<div class="navbar-item">
<a class="" href="#"> Docs </a>
</div>
<div class="navbar-item ">
<a class="" href="#"> Report </a>
</div>
<div class="navbar-item">
<a class="">More</a>
</div>
<div class="navbar-item">
<a class="">Logout</a>
</div>
</div>
</div>
</nav>
</div>
</div>
</template>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Get all "navbar-burger" elements
var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0)
// Check if there are any navbar burgers
if ($navbarBurgers.length > 0) {
// Add a click event on each of them
$navbarBurgers.forEach(function ($el) {
$el.addEventListener('click', function () {
// Get the target from the "data-target" attribute
var target = $el.dataset.target
var $target = document.getElementById(target)
// Toggle the class on both the "navbar-burger" and the "navbar-menu"
$el.classList.toggle('is-active')
$target.classList.toggle('is-active')
})
})
}
})
export default {
name: 'Navbar',
data () {
return {
msg: ''
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
div{
border: 0px solid black;
}
</style>
As you can see I have tried implementing the example code in on which was present here but with no use. Shouldnt Bulma give me responsive navbar out of the box. All the examples and solutions I have found are for the older "nav" class not the newer "navbar". Help would be much appreciated.
So, after a bit of studying the Vue guide and clues from fatman's comments, this is the fix I applied.
The above code works , but this is a more vue-ish way to do the navbar-burger menu.
<template>
<nav class="navbar">
<div class="container">
<div class="navbar-brand is-large">
<a class="navbar-item" href="#">
<img alt="K R O N O S" height="100px">
</a>
<button #click="makeBurger" class="button navbar-burger" data-target="navMenu" v-bind:class="{ 'is-active': activator }">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div class="navbar-menu" id="navMenu" v-bind:class="{ 'is-active': activator }">
<div class="navbar-end">
<div class="navbar-item">
<a class="" href="#"> Docs </a>
</div>
<div class="navbar-item ">
<a class="" href="#"> Report </a>
</div>
<div class="navbar-item">
<a class="">More</a>
</div>
<div class="navbar-item">
<a class="">Logout</a>
</div>
</div>
</div>
</div>
</nav>
</template>
<script>
export default {
name: 'Navbar',
data () {
return {
msg: '',
activator: false
}
},
methods: {
makeBurger () {
this.activator = !this.activator
return this.activator
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
div{
border: 0px solid black;
}
</style>
Hope this helps someone. The show/hide functionality is taken care by Bulma.
This works, but
will not close the menu
will cause router-links not to work
For 1.) I recommend adding #click to navbar-item as well:
<a #click="makeBurger" class="navbar-item">
<router-link to="/login">
{{link1}}
</router-link>
</a>