inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 13, 2014 10:40:29 GMT -8
To build a simple news ticker or breaking intel ticker for SHIELD I'm utilising currently this code:
$( document ).ready(function() {
var inteltick = pb.plugin.get('mm_newsTicker');
$("#NewIntel").append("<ul id='ticker'><li>"+inteltick.settings.ticker[01].intel+"</li><li>"+inteltick.settings.ticker[02].intel+"</li><li>"+inteltick.settings.ticker[03].intel+"</li><li>"+inteltick.settings.ticker[04].intel+"</li></ul>");
function tick(){
$('#ticker li:first').animate({'opacity':0}, 200, function () { $(this).appendTo($('#ticker')).css('opacity', 1); });
}
setInterval(function(){ tick () }, 10000);
});
With this css:
#ticker {
height: 40px;
overflow: hidden;
}
#ticker li {
height: 40px;
} Would someone be able to help me and advise me on how to use a for loop effectively to keep a similar layout while using a for loop rather then having to add more items manually
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jul 13, 2014 12:52:42 GMT -8
you mean this part right?
$("#NewIntel").append("<ul id='ticker'><li>"+inteltick.settings.ticker[01].intel+"</li><li>"+inteltick.settings.ticker[02].intel+"</li><li>"+inteltick.settings.ticker[03].intel+"</li><li>"+inteltick.settings.ticker[04].intel+"</li></ul>");
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 13, 2014 13:00:58 GMT -8
Yes that part precisely
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jul 13, 2014 13:21:01 GMT -8
$("#NewIntel").append("<ul id='ticker'></ul>'); for (tt=0, ticker=inteltick.settings.ticker; tt<ticker.length; tt++) { $("#NewIntel ul").append("<li>"+ticker[tt].intel+"</li>"); }
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 13, 2014 22:00:48 GMT -8
Thank you! I tried obvious obvious didn't work so I wasn't sure how to make it play
Ignore all its fixed!
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jul 13, 2014 23:09:07 GMT -8
recheck what I have above. I didnt notice that it converted the array indices into BBcode.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 13, 2014 23:44:09 GMT -8
That one seems to cause it to freeze on the second one down shieldrp.comIt seems to be being unable to now utilise tick where the original one once I adjusted the middle bit to include did work
$( document ).ready(function() {
var inteltick = pb.plugin.get('mm_newsTicker');
$("#NewIntel").append("<ul id='ticker'></ul>");
for (tt=0, ticker=inteltick.settings.ticker; tt<ticker.length; tt++) {
$("#NewIntel ul").append("<li>"+ticker[tt].intel+"</li>");
$('#ticker li:first').animate({'opacity':0}, 200, function () { $(this).appendTo($('#ticker')).css('opacity', 1); });
}
/*setInterval(function(){ tick () }, 4000);*/
}); I've tried the setInterval inside the last bracket and outside its coming up with "Uncaught ReferenceError: tick is not defined"
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jul 14, 2014 0:37:32 GMT -8
where did you define the function for tick?
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 14, 2014 2:15:59 GMT -8
-headdesk- I'M BLAMING HEAT!
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Jul 14, 2014 7:06:41 GMT -8
Miami basketball has a way of doing that to people
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jul 14, 2014 7:40:47 GMT -8
xD Its too hot in the UK ¬¬ When its reaching 25 degrees in shade it frazzles my brain!
|
|