We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 3
[ C ] news bar ticker
Topic Started: May 3 2013, 11:03 PM (2,624 Views)
lala1993
Member
[ *  * ]
Board Address: (Link to your board) Private
Board Software: (ZetaBoards or InvisionFree)
Description: (What you want your code to do)

I'd like to have news bar ticker like this one on my board. For an example " latest news" head bar with " message what happen around the world" with url link read more. I don't want the news bar message to be refresh or reloading the pages when I reading something on next pages.

news bar


Offline Profile Goto Top
 
Replies:
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
You can use this:
Code:
 
<style type="text/css">
span.message {
display: block;
height: 90px;
}
</style>
The 90 can be changed as necessary.
Offline Profile Goto Top
 
lala1993
Member
[ *  * ]
Cory
May 7 2013, 12:09 AM
You can use this:
Code:
 
<style type="text/css">
span.message {
display: block;
height: 90px;
}
</style>
The 90 can be changed as necessary.
where do I put this code?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Javascripts
Offline Profile Goto Top
 
lala1993
Member
[ *  * ]
lala1993
May 7 2013, 12:10 AM
Cory
May 7 2013, 12:09 AM
You can use this:
Code:
 
<style type="text/css">
span.message {
display: block;
height: 90px;
}
</style>
The 90 can be changed as necessary.
where do I put this code?
It's still giving me the same result I need to fixed width and fixed height so that it doesn't expand and contract around the text - which makes the page jump to accommodate the change in size.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
On second thought, don't worry about the CSS and change the JavaScript to this:
Code:
 
<script type="text/javascript">
//<![CDATA[
$('span.message:not(span.first)').hide();
$('span.message.first').css({
'display': 'block',
'height': '90px'
});

function nextMessage() {
$('span.message:visible').hide().next('span.message:hidden').fadeTo('slow', 1.0).css({
'display': 'block',
'height': '90px'
});

if ($('span.message:visible').length === 0) {
$('span.message.first').fadeTo('slow', 1.0);
}
}

window.setInterval(nextMessage, 5000);
//]]>
</script>
Offline Profile Goto Top
 
lala1993
Member
[ *  * ]
Cory
May 7 2013, 12:32 AM
On second thought, don't worry about the CSS and change the JavaScript to this:
Code:
 
<script type="text/javascript">
//<![CDATA[
$('span.message:not(span.first)').hide();
$('span.message.first').css({
'display': 'block',
'height': '90px'
});

function nextMessage() {
$('span.message:visible').hide().next('span.message:hidden').fadeTo('slow', 1.0).css({
'display': 'block',
'height': '90px'
});

if ($('span.message:visible').length === 0) {
$('span.message.first').fadeTo('slow', 1.0);
}
}

window.setInterval(nextMessage, 5000);
//]]>
</script>
Thanks for all you do Cody... I still getting the same result again.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I'm still seeing the old version on your board and it appears to be in the Javascripts wrapper. The JavaScript should be in the Below the Board wrapper.

You have </a> after every <span class="message"> start tag, that's not needed. Also, use quotation marks around HTML attribute values:
Code:
 
<a href="URL">[Read More]</a>
Right above the bbcodequickcompose.js code the ending tag is not complete:
Code:
 
</script
Offline Profile Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
This code works great, but My Members are having trouble deciding which .rss feed they'd prefer. There's a slight victor in a vote we had, but it wasn't what could be called a "landslide" victory for it.

I was wondering... if I create a custom "My .RSS Preference" (or something like that) entry in the member profile, could this script be adapted to read that and feed individual .rss feeds (and if they leave it blank, not feed one at all and not take out the space at the top either)?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Use this for the JavaScript instead, for the custom profile field you create make sure all options are set to No.
Code:
 
<script type="text/javascript" src="http://z3.ifrm.com/63/1/0/f673511/jqueryzrssfeedmin.js"></script>

<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
var pField = 'PROFILE_FIELD_NAME';
var uID = $.zb.stat.mid;

$.get(main_url + 'profile/' + uID + '/', function (data) {
var pFieldData = $('table.profile td.c_desc:contains(' + pField + ')', data).next('td').text();

$('#rss').rssfeed(pFieldData, {
limit: 5
});

function nextMessage() {
$('li.rssRow:visible').hide().next('li.rssRow:hidden').fadeTo('slow', 1.0);

if ($('li.rssRow:visible').length === 0) {
$('li.rssRow:eq(0)').fadeTo('slow', 1.0);
}
}

window.setInterval(nextMessage, 5000);
});
$.get(location.href);
});
//]]>
</script>
Change PROFILE_FIELD_NAME.
Offline Profile Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
Cool! I'll give it a shot!

Thanks dude. You seriously rock!

ETA: using the new code, I get a "The specified feed URL is invalid" even using the RSS feed I was using with the old code.
Edited by RichardInTN, May 15 2013, 07:45 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Cory
May 15 2013, 07:11 PM
Change PROFILE_FIELD_NAME.
It should be:
Quote:
 
My RSS Preference
Offline Profile Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
Oops.

LOL

I knew there was something I was forgetting.

Thanks!
Well... I did need to do that... but the problem still exists. Even after correcting that, I still get "The specified feed URL is invalid".
Edited by RichardInTN, May 15 2013, 08:12 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Try putting it in the Below the Board wrapper.

If that doesn't work, please approve my test account.
Offline Profile Goto Top
 
RichardInTN
Member Avatar
I believe in I.D.I.C.
[ *  *  * ]
That just moved the message to the bottom of the board.

ETA: so I moved it back to "above the board"

ETA II: You're in. Do you need any special permissions to work on this... or are you just wanting to see what's going on?

ETA III: I gave you temporary access to "Board Template"... just in case
Edited by RichardInTN, May 15 2013, 08:40 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Cory
May 15 2013, 07:11 PM
...for the custom profile field you create make sure all options are set to No.
You didn't do this.

The script can go in either wrapper I suppose. The DIV dictates where the feed appears.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Closed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 3