Jump to content

chasethemetal

Members
  • Content Count

    169
  • Joined

  • Last visited

Everything posted by chasethemetal

  1. This is my hack solution...if(percentPlayed >= 1.0000000000000000 && percentPlayed <= 1.1000000000000000){ if anyone can think of something better let me know
  2. Update: So when I remove the parseInt() I notice it is actually counting the percentage like so 1.2343454345656677 incrementally up... This is accounting for the random 7 to 11 entries in my database, because percentPlayed is equal to one as it incrementally creeps up until it passes that 2.00... threshold. Now I thought I could just do this percentPlayed == "1.0000000000000000" right? But it's chance that the percent would land EXACTLY on 1.0000000000000000. Is there anyway to make this only happen once? Is this just an inherent problem with the media players counting?
  3. Hey all. So I have a media player... And I am trying to log information in a database about the percent played. For starters this one... percentPlayed == "1" logs that media was started. But for some reason or another it logs between 7-11 entries per time!? It is behaving as if percentPlayed equals 1, 7 to 11 times in a fraction of a second... Also I have php adding a record like so... count=count+1, so I don't think its an issue there. Any thoughts? Is there a way to add .load_once haha? Anyways, any help is always appreciated. (i have verified that this var outputs a percent count up accura
  4. I figured it out. The reason it was confusing was there was a mysterious amount of whitespace on the front of the string that I had to eliminate... Here's my final solution. var name = $.trim($(my_name).text().substr(10).replace(/ /g,'%20'));$("#name").load('handle.php?name='+name);
  5. Hey all! This is my working jquery line right now... $("#name").text($(my_name).text()); This takes the value of my_name and puts it in a div with the id of name. Great.... But now I am looking for away to append it to the end of a url like so.... $('#name').load('handle.php?name='+ my_name); This above doesn't work. I am just trying hard to figure out how I can get the value that goes into the DIV to instead be placed as text at the end of a url to be processed by my script. Thanks any help would be appreciated!
  6. figured it out.... var a = parseInt(event.player.status.currentPercentAbsolute, 10) + "%";if (a == "2%") { $("#count").html("WORKED");}
  7. Ok thanks, I knew ajax was a route... One final question (this should be moved into the javascript section)... How could I assign the value of $("#count").text(parseInt(event.player.status.currentPercentAbsolute, 10) + "%"); to a var... This is what I am trying to accomplish... var a = $("#count").text(parseInt(event.player.status.currentPercentAbsolute, 10) + "%"); if (a == "2%") { do something };
  8. Hey all! So I have a jquery counter, and it prints the count into a <div>. I know this doesn't work... But this is what I am trying to accomplish.... <?php $a = '<div id="count"></div>'; if ($a == '5') Do something ?> Now the counting is happening in Jquery because it's part of a media player, and I am trying to make the page do something once it's say 5 seconds into playing... This is what the line of jquery looks like that's creating the event...$("#count").text(parseInt(event.player.status.currentPercentAbsolute, 10) + "%"); Any help, pointers, or tips n tricks would
  9. The Mage wins!!! Thanks so much. I thought I adjusted and tried all = or == combos, but I must have not because this has the desired simple effect. Thanks for everyone's thoughts. However the simple function above creates a simple toggle between classes, while using :hover to handle the rollover. Clean and simple, thanks guys!
  10. The code I'm using must be with <div>'s. I'm not sure if the above example will help? Also the code works to change the class, BUT does not toggle it back n forth if I adjust the function to have single '=' and not '==' function toggleClass(elem) {if (elem.className = 'one') {elem.className = 'two';} else {elem.className = 'one';}}
  11. But the question now is why does this work? <div class="one" onClick="className='two'"></div> This obviously doesn't have the desired toggle effect. but it does change the class...
  12. Ok thanks I'll look into it. It doesn't appear to be working in Safari, Chrome or Firefox.
  13. i might be missing something here. But my script looks like this, and the toggle doesn't work. <script type="text/javascript"> function toggleClass(elem) { if (elem.className == 'one') { elem.className == 'two'; } else { elem.className == 'one'; }} </script><style type="text/css">.one{width:50px;height:50px;background-color:#000;cursor:pointer;} .one:hover{width:50px;height:50px;background-color:#CCC;cursor:pointer;} .two{width:50px;height:50px;background-color:#F00;cursor:pointer;} .two:hover{width:50px;height:50px;background-color:#00F;cursor:pointe
  14. I'm searching for a way to change the event handler onmouseover with the onclick event. So that way when you click it changes all of the onmouseover and onmouseout AND the onclick events. Basically swapping styles. I guess a good example for what I trying to do would be to picture this as a play button. When your mouse is over the play, the play button changes color. When you click play it turns into a pause button, but then stays a pause button, and then when you click it again it turns into a play button.
  15. I guess I'm confused to how that works. I'm assuming it would look something like if className = two then setAttribute.mouseover='two-over' and setAttribute.mouseout='two' and setAttribute.onClick='one'. I am going to investigate this, but if you know of any articles dealing with it, point them my way.
  16. In the perfect world there would be a this.onmouseoverName="value" or a this.onmouseoverValue="value"
  17. Hey all. I am trying to write a little script that changes the values of onmouseover, onmouseout, and onclick when someone clicks. Let me show you what I mean... <a href="#" class="a_one><div class="one" onmouseover="this.className='one-over'" onmouseout="this.className='one'" onClick="this.className='two'"></div></a> This works of course, BUT when someone clicks.... I need the code to switch to this..... <a href="#" class="a_two><div class="two" onmouseover="this.className='two-over'" onmouseout="this.className='two'" onClick="this.className='one'"></di
  18. Hey all. I was wondering on average how much a senior developer would charge to work with a web upstart company? Let's picture this company as something you find interesting and innovative as well. Also you aren't flying this ship alone, you would have a small staff of junior developers to aid you. Technologies involved would include: Broad understanding of servers, and operating systems, PHP, JavaScript, HTML, CSS. Scenario One - Hourly rate Scenario Two - Salary Scenario Three - Salary BUTyou are cut in as part of the company, if the company does well your salary is increased as well as own
  19. Hey all just thought I'd share more. I realized I needed more out of this then just changing the map type. I needed to change variables in my php script which populated the information as well. I came up with a simple solution that I thought I should share. I changed this function.... google.visualization.events.addListener(geomap, 'regionClick', function(e) {options['region'] = e['region'];geomap.draw(data, options);}); AND now this function looks like this: google.visualization.events.addListener(geomap, 'regionClick', function(e) {window.open ("http://www.website.com/script.php?region="+ e
  20. Figured it out! Just had to throw the geo.draw in again! Thanks so much for your help! <script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load('visualization', '1', {packages: ['geomap']}); function drawVisualization() {var data = new google.visualization.DataTable();data.addRows(4);data.addColumn('string', 'Country');data.addColumn('number', 'Popularity'); data.setValue(0, 0, 'United States');data.setValue(0, 1, 166);data.setValue(1, 0, 'Canada');data.setValue(1, 1, 10);data.setValue(2, 0, 'Iran');data.setValue(2
  21. Well. I Guess I assumed if it changed the variable it would change the map. And the map doesn't change. So I guess I need it to reload the page with the new variable in place? I am trying to make it so when you click a region, it changes the map to the zoomed in version of that region.
  22. Any more pointers would be appreciated!
  23. I see how now we are calling the function and assigning it the the options['region']. But however when I click this does nothing. This is what the full code looks like now. <script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load('visualization', '1', {packages: ['geomap']}); function drawVisualization() {var data = new google.visualization.DataTable();data.addRows(4);data.addColumn('string', 'Country');data.addColumn('number', 'Popularity'); data.setValue(0, 0, 'United States');data.setValue(0, 1, 166);data.setVal
  24. Thanks! I thinkkkk I know what you're talking about. Is there anyway you could show me an example of this in my code?
×
×
  • Create New...