Pawan
Pawan

Reputation: 32331

How to resolve white space while using marquee tag

In my website i am displaying Live news (scrolling functionality) by using marquee tag .

The issue i am facing once the scrolling is completed , a white space is being shown

Please see the image with respect to the issue

enter image description here

Some part of my code

function displaylivenews() {
    var s = "";

            for (var i = 0; i < latestnewsresponse.length; i++) {
                s += '<li><div class="itemTitle"><a href="' + latestnewsresponse[i].link + '"  target="_">' + latestnewsresponse[i].title + "</a></div>";
                s += '<div class="itemDate">' + latestnewsresponse[i].pub_date + "</div>";
                mysource = latestnewsresponse[i].link.split("://")[1].split('/')[0].replace(/(www.)|(.com)/g, '');
                s += '<div class="Source">' + mysource + "</div>";
                s += '</li>'
            }
            jQuery("#livenewsRss").html("<ul class='feedEkList'>" + s + "</ul>");


    }

and this is my jsfiddle

http://jsfiddle.net/6n8ecLq6/5

Could you please let em know how to resolve this issue ??

Upvotes: 1

Views: 2434

Answers (3)

Zakaria Acharki
Zakaria Acharki

Reputation: 67525

When i search for marquee tag i found a lot of warnings like :

Obsolete This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Note: The HTML tag may not be supported by various browsers so its not recommended to rely on this tag, instead you can use Javascript and CSS to create such effects.

Take a look at the following questions :

You can see that the marquee tag it was DEPRECATED by the W3C (W3C Obsolete features), and you can't find any direct solution for the blank space relative with tag over the web, but fortunately you can find a lot of similar plugins (JQuery, javascript, CSS3) do the work everywhere, e.g:

Hope this helps.

Upvotes: 1

Susheel Singh
Susheel Singh

Reputation: 3854

Marquee is a deprecated and not a valid HTML tag. You can use many jQuery plugins to do. One of it is jquery easy ticker. There are many more!

Upvotes: 1

Yabada
Yabada

Reputation: 1758

If your latestnewsresponse is empty, you will set a new empty <ul> element. The white space might be the padding/margin of this empty element.

if (s != "")
   jQuery("#livenewsRss").html("<ul class='feedEkList'>" + s + "</ul>");

Upvotes: 0

Related Questions