2
I’m trying to make an image go up to the top by clicking on it below. After you have climbed I want you to click ( click here to close) I want you to start a count of 5 seconds and then close when you finish those 5 seconds. It’s like an ad. See here on the site:>> https://jsfiddle.net/9hxkL4ba/15/
jQuery.cookie = function(key, value, options) {
// key and at least value given, set cookie...
if (arguments.length > 1 && String(value) !== "[object Object]") {
options = jQuery.extend({}, options);
if (value === null || value === undefined) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires,
t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
value = String(value);
return (document.cookie = [
encodeURIComponent(key), '=',
options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || {};
var result, decode = options.raw ? function(s) {
return s;
} : decodeURIComponent;
return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1005]) : null;
};
jQuery(document).ready(function($) {
if ($.cookie('popup_facebook_box') != 'yes') {
$('#fbox-background').delay(5000).fadeIn('medium');
$('#fbox-button, #fbox-close').click(function() {
$('#fbox-background').stop().fadeOut('medium');
});
}
$.cookie('popup_facebook_box', 'yes', {
path: '/',
expires: 1
});
});
#fbox-display {
background: url(https://i.imgur.com/txK4QBP.png);
border: 0px solid gray;
padding: 1px;
width: 350px;
height: 237px;
position: fixed;
top: 32%;
left: 35%;
}
.st_font {
background: #B6000000;
color: #FFF;
padding: 5px;
font-size: 16px;
}
img#fbox-close {
position: absolute;
top: 100%;
left: 0px;
width: 350px;
height: 40px;
z-index: 2147483646;
margin: 0;
padding: 0;
cursor: pointer;
border-radius: 5px;
}
#fbox-link,
#fbox-link a.visited,
#fbox-link a,
#fbox-link a:hover {
color: #aaaaaa;
font-size: 9px;
text-decoration: none;
text-align: center;
padding: 5px;
}
#fbox-background {
display: block;
background: rgba(0, 0, 0, 0.8);
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 99999;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.2/knockout-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id='fbox-background'>
<div id='fbox-display'>
<img id="fbox-close" src="https://i.imgur.com/TdlMROf.jpg">
<div class="st_font">
<div id='fbox-button'></div>
</div>
</div>
</div>
what I really wanted was this way in the image > https://i.imgur.com/Tzahmja.png
– Felipe Silva
Okay. I’ll analyze it.
– Sam
You want me to go up and down?
– Sam
You want the click part to go up, meaning the user will have to click 2 times to start the count. That’s it?
– Sam
Yeah, I can’t do that
– Felipe Silva
I changed the answer and Fiddle.
– Sam
obg, man.. it was like this msm.
– Felipe Silva