Results 1 to 4 of 4

Thread: Script Help

  1. #1

    Question Script Help

    Hi,

    I need help figuring a way to complete my website fully. I use WHMCS as my main website and can pull prices straight from the database when the currency updates from the cron. I can display these on my website.

    However I would like to display both and $ on my website, currently only is displayed.

    I need something that will have floating images to change the currency, and when clicked shows a different value within it? This can be a php/javascript/css/html anything, I am unsure what to search within Google to achieve this desired affect.

    More Detail....

    On the top of my website I will have a $ sign and a sign, My main currency will be and will be displayed by default as shown in the code below.

    Code:
    <span class="price">&pound;**price**</span> / year
    When someone clicks the $ sign the above code will change to

    Code:
    <span class="price">$**price**</span> / year
    How can I achieve this simple script that will not cause a page reload and work fast. maybe hide divs until button pressed? jquery script? I am just not sure what to search for. Any help with this would be appreciated.
    ZealHost.com - Passionate About Hosting & Our Environment.
    Shared Hosting | VPS Hosting | Dedicated Servers
    Cheap Domains | SSL Certificates
    Speak To Us Today via Livechat!

  2. #2

    using jquery easily change value without page load

    using jquery easily change value without page load

    Quote Originally Posted by Dominator24 View Post
    Hi,

    I need help figuring a way to complete my website fully. I use WHMCS as my main website and can pull prices straight from the database when the currency updates from the cron. I can display these on my website.

    However I would like to display both and $ on my website, currently only is displayed.

    I need something that will have floating images to change the currency, and when clicked shows a different value within it? This can be a php/javascript/css/html anything, I am unsure what to search within Google to achieve this desired affect.

    More Detail....

    On the top of my website I will have a $ sign and a sign, My main currency will be and will be displayed by default as shown in the code below.

    Code:
    <span class="price">&pound;**price**</span> / year
    When someone clicks the $ sign the above code will change to

    Code:
    <span class="price">$**price**</span> / year
    How can I achieve this simple script that will not cause a page reload and work fast. maybe hide divs until button pressed? jquery script? I am just not sure what to search for. Any help with this would be appreciated.

  3. #3
    Hi thanks for you reply, but your response was rather broad, I was hoping a more detailed response with maybe a link to the script etc.

    Thanks.
    ZealHost.com - Passionate About Hosting & Our Environment.
    Shared Hosting | VPS Hosting | Dedicated Servers
    Cheap Domains | SSL Certificates
    Speak To Us Today via Livechat!

  4. #4
    Does this only need to work on one page, or when the user clicks a currency does it need to remember that currency for subsequent page views? The latter could be achieved with a cookie, but I'll leave it out in the example below for now so it doesn't complicate things if you don't need it.

    Code:
    <!-- these would be your currency links -->
    <a href="javascript:void(0)" onclick="changeCurrency('gbp')">&pound;</a>
    <a href="javascript:void(0)" onclick="changeCurrency('usd')">$</a>
    
    <!-- your prices -->
    <span class="price-gbp">&pound; PRICE</span>
    <span class="price-usd" style="display:none;">$ PRICE</span>
    
    <span class="price-gbp">&pound; ANOTHER PRICE</span>
    <span class="price-usd" style="display:none;">$ ANOTHER PRICE</span>
    
    <!-- and a bit of javascript -->
    <script type="text/javascript">
    var selectedCurrency = 'gbp';
    function changeCurrency(currency) {
        // out with the old...
        var priceElements = document.getElementsByClassName("price-"+selectedCurrency);
        for(var x = 0; x < priceElements.length; x ++) {
            priceElements[x].style.display="none";
        }
        // ...and in with the new
        selectedCurrency = currency;
        priceElements = document.getElementsByClassName("price-"+selectedCurrency);
        for(x = 0; x < priceElements.length; x ++) {
            priceElements[x].style.display="inline";
        }
    }
    </script>
    Ken S. - RateLobby
    Collect & Display Real Customer Testimonials
    Featured Reviews / Widgets / Dispute Resolution

Similar Threads

  1. Replies: 2
    Last Post: 07-17-2011, 09:10 PM
  2. Replies: 14
    Last Post: 06-08-2006, 08:41 PM
  3. iHost 1.01 - Auto Account Creation and Billing Script | iSupport 1.05 Helpdesk Script
    By listenmirndt in forum Other Web Hosting Related Offers
    Replies: 2
    Last Post: 02-14-2005, 01:50 PM
  4. iHost 1.0 - Auto Account Creation and Billing Script | iSupport 1.05 Helpdesk Script
    By listenmirndt in forum Other Web Hosting Related Offers
    Replies: 4
    Last Post: 01-10-2005, 01:27 AM

Related Posts from theWHIR.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •