/    Sign up×
Community /Pin to ProfileBookmark

Removing Slideshow elements form html file

Hi.

I have changing some things in a slideshow and need your help.

In the html, I have this class:

[CODE]
<div class=”element” data-animate=”slideAppearRightToLeft” data-delay=”800″ data-length=”300″>First Title</div>
[/CODE]

And this code in the javascript file:

[CODE]
$.fn.responsiveSlider.animations = {
slideAppearRightToLeft: function($caption, delay, length) {
var animate, css;
if (delay == null) {
delay = 0;
}
if (length == null) {
length = 300;
}
css = {
‘margin-left’: 100,
‘margin-right’: -100
};
$caption.css(css);
animate = function() {
css = {
‘margin-left’: 0,
‘margin-right’: 0,
‘opacity’: 1
};
return $caption.animate(css, length);
};
if (delay > 0) {
return setTimeout(animate, delay);
} else {
return animate();
}
},
[/CODE]

Is there any way to remove the atributes in the class and put them in the javascript file.

I have tried by myself just to collect a series of errors and failures.

Best regards.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Gray1989Jan 25.2014 — I'm assuming you're looking to specify the [I]attributes[/I] in the JavaScript file. Since you're using jQuery, this example should work:

[CODE]$caption.attr('data-delay','800');[/CODE]

If you're actually looking to create the element with JavaScript instead, I suggest you look at this page.
Copy linkTweet thisAlerts:
@andresbauthorJan 25.2014 — The idea is to remove all the atributes in the class and leave like this:

<div class="element">First Title</div>

Creating than the animate effect in the Javascript file.
Copy linkTweet thisAlerts:
@Gray1989Jan 25.2014 — Yeah then my suggestion should work
×

Success!

Help @andresb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...