Jump to content
Guests can now reply in ALL forum topics (No registration required!) ×
ShiaChat.com
Guests can now reply in ALL forum topics (No registration required!)
In the Name of God بسم الله

How to loop words on a website?


Recommended Posts

  • Advanced Member

:salam:

I don't know how to put it. I had seen a theme that had a couple of words that kept repeating on the same place on the website, as if they are in a loop. I found it quite interesting and want to incorporate that in my website.

So, for example, take this sentence: I want to go to the gym.

Now, the word 'want' will be replaced by the word 'need' and that in turn will be replaced by the word 'intend' and then again back to the word 'want'. 

Does anybody know how to do that?

Link to post
Share on other sites
4 minutes ago, Inquisitor said:

:salam:

I don't know how to put it. I had seen a theme that had a couple of words that kept repeating on the same place on the website, as if they are in a loop. I found it quite interesting and want to incorporate that in my website.

So, for example, take this sentence: I want to go to the gym.

Now, the word 'want' will be replaced by the word 'need' and that in turn will be replaced by the word 'intend' and then again back to the word 'want'. 

Does anybody know how to do that?

I'm sure you can do it by Css3 or JQuery.

Link to post
Share on other sites
  • Advanced Member
18 minutes ago, Haimi said:

i think you can do it with CSS3 animation(fade or transparency attributes) or by JQuery Animation codes. sorry if i can not help more than that.

 

10 minutes ago, Jaf said:

fadeIn().fadeOut() jQuery search on stackoverflow... you are gonna find out good number of examples...

Thank you for your replies brothers. 

Where should I ask that person to search for that thing? Is there a website where he can find it?

Also, brother Jaf, what is that command? Should I ask him to incorporate that command?

Link to post
Share on other sites

lol.. i just noticed i am doing it on my company website here is the code

<p style="margin-top:-30px;margin-bottom:50px;height:50px;" class="importBizBig">
                              <span class="switchCountry">China</span> 
                              <span class="switchCountry">United States</span> 
                              <span class="switchCountry">United Kingdom</span> 
                              <span class="switchCountry">Germany</span> 
                              <span class="switchCountry">Singapore</span> 
                              <span class="switchCountry">Hong Kong</span> 
                              <span class="switchCountry">Taiwan</span> 
                              <span class="switchCountry">France</span> 
                              <span class="switchCountry">South Korea</span> 
                              <span class="switchCountry">Japan</span> 
                              <span class="switchCountry">Malaysia</span> 
                              <span class="switchCountry">Italy</span> 
                              <span class="switchCountry">Spain</span> 
                              <span class="switchCountry">Denmark</span> 
                              <span class="switchCountry">Netherlands</span> 
                              <span class="switchCountry">Thailand</span> 
                              <span class="switchCountry">United Arab Emirates</span> 
                              <span class="switchCountry">Indonesia</span> 
                              <span class="switchCountry">Belgium</span>
                              <span class="switchCountry">Norway</span> 

            </p>

 <script>
// code gets installed at the end of the body (after all other HTML)
$(document).ready(function() {

    var quotes = $(".switchCountry");
    var quoteIndex = -1;

    function showNextQuote() {
        ++quoteIndex;
        quotes.eq(quoteIndex % quotes.length)
            .fadeIn(2000)
            .delay(2000)
            .fadeOut(2000, showNextQuote);
    }

    showNextQuote();

})();
</script>

b393ais.gif 

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...