hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Design and Content : Script Help
Reply

Forum Jump

Script Help

Reply Post New Thread In Web Design and Content Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 03-31-2012, 01:28 PM
Dominator24 Dominator24 is offline
Newbie
 
Join Date: Apr 2010
Location: UK & USA
Posts: 18
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!

Reply With Quote


Sponsored Links
  #2  
Old 03-31-2012, 02:45 PM
qbicblack qbicblack is offline
New Member
 
Join Date: Aug 2011
Posts: 1
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.

Reply With Quote
  #3  
Old 03-31-2012, 06:40 PM
Dominator24 Dominator24 is offline
Newbie
 
Join Date: Apr 2010
Location: UK & USA
Posts: 18
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!

Reply With Quote
Sponsored Links
  #4  
Old 04-01-2012, 09:53 PM
RateLobby RateLobby is offline
WHT Addict
 
Join Date: Feb 2012
Posts: 108
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

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Bash Script] How to set up redirect of script output within script 96mb Programming Discussion 2 07-17-2011 09:10 PM
Clearance - MS script, SMS script, Train script, Game Cheat Scripts & More!! cnv Other Offers & Requests 14 06-08-2006 08:41 PM
iHost 1.01 - Auto Account Creation and Billing Script | iSupport 1.05 Helpdesk Script listenmirndt Other Web Hosting Related Offers 2 02-14-2005 01:50 PM
iHost 1.0 - Auto Account Creation and Billing Script | iSupport 1.05 Helpdesk Script listenmirndt Other Web Hosting Related Offers 4 01-10-2005 01:27 AM

Related posts from TheWhir.com
Title Type Date Posted
Service Providers Push Updates to Fight OpenSSL Heartbleed Bug Web Hosting News 2014-05-01 08:31:27
Web Hosting Sales and Promos Roundup - December 6, 2013 Web Hosting News 2014-05-23 15:42:37
Nasuni Launches Cloud Mirroring Feature to Storage Solution Web Hosting News 2013-08-08 14:15:27
OpenStack and the AWS API Debate Web Hosting News 2014-05-09 12:40:29
Pingdom Talks Top Web Hosting Cities and Countries Web Hosting News 2014-05-09 12:40:35


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?