Javascript ?", 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“餐厅”, }, { 背景:“img/slider/beverages.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“packages.html”, id:“饮料”, }, { 背景:“img/slider/cake.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“packages.html”, id:“蛋糕”, }, { 背景:“img/slider/fruit.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“水果”, }, { 背景:“img/slider/screery.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_conv.html”, id:“杂货店”, }, { 背景:“img/slider/flower.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“packages.html”, id:“花”, }, { 背景:“img/slider/vegets.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“蔬菜”, }, { 背景:“img/slider/organic.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“有机”, }, { 背景:“img/slider/office.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“办公室”, }, { 背景:“img/slider/Supermarket.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“超市”, } ]; $。每个(滑块_详细信息,函数(x,y){ html+=''; html+=''; html+=''; html+=''+y.text1+''; html+=''+y.text2+''; html+=''+y.text3+''; html+=''; html+=''; html+=''; html+=''; html+=''; }); //sessionStorage.setItem('x',document.getElementById('type').value); } $(文档).ready(函数(){ $(“输入”)。单击(函数(){ var值=$(this.val() 警报(值); }); }); $('.owl carousel').html(html); 函数testfunc(){ var g=document.getElementsByClassName(“type”).value; document.getElementById('lblsd')。value=g; }
我认为您的脚本有错误。我已修复,请检查Javascript ?", 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“餐厅”, }, { 背景:“img/slider/beverages.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“packages.html”, id:“饮料”, }, { 背景:“img/slider/cake.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“packages.html”, id:“蛋糕”, }, { 背景:“img/slider/fruit.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“水果”, }, { 背景:“img/slider/screery.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_conv.html”, id:“杂货店”, }, { 背景:“img/slider/flower.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“packages.html”, id:“花”, }, { 背景:“img/slider/vegets.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“蔬菜”, }, { 背景:“img/slider/organic.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“有机”, }, { 背景:“img/slider/office.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“办公室”, }, { 背景:“img/slider/Supermarket.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd.html”, id:“超市”, } ]; $。每个(滑块_详细信息,函数(x,y){ html+=''; html+=''; html+=''; html+=''+y.text1+''; html+=''+y.text2+''; html+=''+y.text3+''; html+=''; html+=''; html+=''; html+=''; html+=''; }); //sessionStorage.setItem('x',document.getElementById('type').value); } $(文档).ready(函数(){ $(“输入”)。单击(函数(){ var值=$(this.val() 警报(值); }); }); $('.owl carousel').html(html); 函数testfunc(){ var g=document.getElementsByClassName(“type”).value; document.getElementById('lblsd')。value=g; },javascript,jquery,css,Javascript,Jquery,Css,我认为您的脚本有错误。我已修复,请检查 var-slider\u详细信息; var html=“”; 旋转木马() 函数旋转木马(){ 滑块\u详细信息=[ { 背景:“img/slider/fastfood.jpg”, text1:“什么类型的”, 文本2:“你在做什么生意?”, 文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”, text4:“开始”, url:“package_bsd_2+3.html”, id:“快餐”, }, { 背景:“img/slider/resta
var-slider\u详细信息;
var html=“”;
旋转木马()
函数旋转木马(){
滑块\u详细信息=[
{
背景:“img/slider/fastfood.jpg”,
text1:“什么类型的”,
文本2:“你在做什么生意?”,
文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”,
text4:“开始”,
url:“package_bsd_2+3.html”,
id:“快餐”,
},
{
背景:“img/slider/restaurant.jpg”,
text1:“什么类型的”,
文本2:“你在做什么生意?”,
文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”,
text4:“开始”,
url:“package_bsd.html”,
id:“餐厅”,
},
{
背景:“img/slider/beverages.jpg”,
text1:“什么类型的”,
文本2:“你在做什么生意?”,
文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”,
text4:“开始”,
url:“packages.html”,
id:“饮料”,
},
{
背景:“img/slider/cake.jpg”,
text1:“什么类型的”,
文本2:“你在做什么生意?”,
文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”,
text4:“开始”,
url:“packages.html”,
id:“蛋糕”,
},
{
背景:“img/slider/fruit.jpg”,
text1:“什么类型的”,
文本2:“你在做什么生意?”,
文本3:“我们为客户提供最好的服务,尊重他们的商业设计理念。”,
文本4:“通用电气
<script>
carousel();
function carousel() {
var slider_details = [
{
background: "img/slider/fastfood.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_bsd_2+3.html",
id: "fastfood",
},
{
background: "img/slider/restaurant.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_bsd.html",
id: "restaurant",
},
{
background: "img/slider/beverages.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "packages.html",
id: "beverages",
},
{
background: "img/slider/cake.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "packages.html",
id: "cake",
},
{
background: "img/slider/fruit.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_bsd.html",
id: "fruit",
},
{
background: "img/slider/grocery.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_conv.html",
id: "grocery",
},
{
background: "img/slider/flower.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "packages.html",
id: "flower",
},
{
background: "img/slider/vegetables.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_bsd.html",
id: "vegetables",
},
{
background: "img/slider/organic.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_bsd.html",
id: "organic",
},
{
background: "img/slider/office.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_bsd.html",
id: "office",
},
{
background: "img/slider/Supermarket.jpg",
text1: "What type of",
text2: "Business are you in?",
text3: "We provide best for our client and respect their business design idea.",
text4: "Get Started",
url: "package_bsd.html",
id: "supermarket",
}
];
var html = "";
$.each(slider_details, function(x,y) {
html += '<div class="text-center item bg-img" data-overlay-dark="7" data-background="'+y.background+'" >';
html += ' <div class="absolute-middle-center caption">';
html += ' <div class="overflow-hidden">';
html += ' <h3 class="alt-font font-size28 sm-font-size18 text-white no-margin">'+y.text1+'</h3>';
html += ' <h1 class="text-white">'+y.text2+'</h1>';
html += ' <p class="margin-30px-bottom sm-margin-20px-bottom sm-display-none">'+y.text3+'</p>';
html += ' <input type="text" class="type" value="'+y.id+'">';
html += ' <a href="'+y.url+'" class="butn medium theme">';
html += ' <span class="alt-font">'+y.text4+'</span><i class="fas fa-angle-right font-size16 sm-font-size14 text-white margin-10px-left"></i>';
html += ' </a>';
html += ' </div>';
html += ' </div>';
html += '</div>';
});
$(document).ready(function(){
$("input").click(function(){
var value = document.querySelector('.type').value;
alert(value);
});
});
$('.owl-carousel').html(html);
// sessionStorage.setItem('x', document.getElementById('type').value);
}
function testfunc(){
var g = document.getElementsByClassName("type").value;
document.getElementById('lblsd').value = g;
}
var html = "";
$.each(slider_details, function(x,y) {
html += '<div class="text-center item bg-img" data-overlay-dark="7" data-background="'+y.background+'" >';
html += ' <div class="absolute-middle-center caption">';
html += ' <div class="overflow-hidden">';
html += ' <h3 class="alt-font font-size28 sm-font-size18 text-white no-margin">'+y.text1+'</h3>';
html += ' <h1 class="text-white">'+y.text2+'</h1>';
html += ' <p class="margin-30px-bottom sm-margin-20px-bottom sm-display-none">'+y.text3+'</p>';
// html += ' <input type="text" class="type" value="'+y.id+'">';
html += ' <a href="'+y.url+'" class="butn medium theme">';
html += ' <span class="alt-font" id="'+y.id+'" >'+y.text4+'</span><i class="fas fa-angle-right font-size16 sm-font-size14 text-white margin-10px-left"></i>';
html += ' </a>';
html += ' </div>';
html += ' </div>';
html += '</div>';
});
<script>
window.onload = function(){
sessionStorage.clear();
}
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=fastfood]").click(function(){
alert("fastfood");
sessionStorage.setItem('x', 'fastfood');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=restaurant]").click(function(){
alert("restaurant");
sessionStorage.setItem('x', 'restaurant');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=beverages]").click(function(){
alert("beverages");
sessionStorage.setItem('x', 'beverages');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=cake]").click(function(){
alert("cake");
sessionStorage.setItem('x', 'cake');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=fruit]").click(function(){
alert("fruit");
sessionStorage.setItem('x', 'fruit');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=grocery]").click(function(){
alert("grocery");
sessionStorage.setItem('x', 'grocery');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=flower]").click(function(){
alert("flower");
sessionStorage.setItem('x', 'flower');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=vegetables]").click(function(){
alert("vegetables");
sessionStorage.setItem('x', 'vegetables');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=organic]").click(function(){
alert("organic");
sessionStorage.setItem('x', 'organic');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=alt-font][id=office]").click(function(){
alert("office");
sessionStorage.setItem('x', 'office');
});
});
</script>
<script>
$(document).ready(function(){
$("[class=type][id=supermarket]").click(function(){
alert("supermarket");
sessionStorage.setItem('x', 'supermarket');
});
});
</script>