Looking to extract information from text.json and integrate it with my jquery.animation().
My goal is similar to the one demonstrated here. Instead of using "data" attributes like in that example, I want to parse the text based on the "ID" property as a key value for each button to display text within middleBubble. The only difference between my version and the example is that my bubble toggles, so the text should be displayed after the animation.
I'm struggling to translate this into code to incorporate it into my jquery.animation(); this concept is new to me. Can someone assist me in coding this so I can comprehend how it functions?
This is the HTML for my animation:
<section class='circle-animation'>
<div class="container-fluid">
<div class="row">
<div class="hidden-xs hidden-sm">
<div class="col-sm-6 col-sm-offset-3 col-sm-pull-1">
<div id="middlepapir" class="jumbotron">
<div class="row">
<img id="placeholder" class="papir img-responsive" src="img/circle/11.png" alt="">
<div class="row">
<div id="all" class="move1 col-sm-4 col-xs-4 col-md-push-4">
<a href="#"><img class="position1 round" src="img/circle/off/home-all-icon-off.png"></a>
</div>
</div>
<div class="row">
<div id="cover" class="move2 col-sm-4 col-xs-4 col-md-push-1">
<a href="#"><img class="position2 round" src="img/circle/off/home-cover-icon-off.png"></a>
</div>
</div>
<div class="row">
<div id="design" class="move3 col-sm-4 col-xs-4 col-md-push-7">
<a href="#"><img class="position3 round" src="img/circle/off/home-design-icon-off.png"></a>
</div>
</div>
<div class="row">
<div id="diy" class="move4 col-sm-4 col-xs-4">
<a href="#"><img class="position4 round" src="img/circle/off/home-diy-icon-off.png"></a>
</div>
</div>
<div class="row">
<div id="marketing" class="move5 col-sm-4 col-xs-4 col-md-push-8">
<a href="#"><img class="position5 round" src="img/circle/off/home-marketing-icon-off.png"></a>
</div>
</div>
<div class="row">
<div id="other" class="move6 col-sm-4 col-xs-4 col-md-push-1">
<a href="#"><img class="position6 round" src="img/circle/off/home-other-icon-off.png"></a>
</div>
</div>
<div class="row">
<div id="special" class="move7 col-sm-4 col-xs-4 col-md-push-4">
<a href="#"><img class="position7 round" src="img/circle/off/home-special-icon-off.png"></a>
</div>
</div>
<div class="row">
<div id="vip" class="move8 col-sm-4 col-xs-4 col-md-push-7">
<a href="#"><img class="position8 round" src="img/circle/off/home-vip-icon-off.png"></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
This is the CSS for the animation:
/**
*
* Position icons into circle (SO)
*
*/
/* -------Up------ */
.move1 {
}
.move2 {
margin-top: -80px;
}
.move3 {
margin-top: -140px;
}
/* --------------- */
/* ------Middle---- */
.move5 {
margin-top: -140px;
}
/* ---------------- */
/* ------Down------ */
.move7 {
margin-top: -80px;
}
.move8 {
margin-top: -195px;
}
/* --------------- */
.round {
width: 140px;
height: 140px;
}
.jumbotron {
display: inline-block;
width: 700px;
height: 600px;
}
.jumbotron img.img-responsive {
width: 450px;
position: absolute;
margin-top: 120px;
margin-left: 60px;
}
Jquery:
// jQuery script for are Circle div whit Scroll Reveal Script
$(document).ready(function(){
/*==========================================
SCROLL REVEL SCRIPTS
=====================================================*/
window.scrollReveal = new scrollReveal();
/*==========================================
WRITE YOUR SCRIPTS BELOW
=====================================================*/
$('.round').click(function(){
$('.papir').animate({
width: ['toggle', 'swing'],
height: ['toggle', 'swing'],
});
});
});
The text available in text.json that I aim to include in my html:
var a = {
"all":{
"id":"all",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}, "cover": {
"id":"cover",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}, "diy": {
"id":"diy",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}, "marketing": {
"id": "marketing",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}, "other": {
"id": "other",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}, "special": {
"id": "special",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}, "vip": {
"id": "vip",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}, "design": {
"id": "design",
"data": {
"datatext": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
}
}
}