[jQuery] MULTIPLE DIV ON COUNTDOWN

2009-05-04 Thread gozigo_milis gozigo_milis
Dear all,
I have function javascript like this

function display_short_lived_counter(seconds, div_name) {
  orig_seconds = seconds;
  if (seconds <= 0) {
  el = document.getElementById(div_name);

  if (el) {
el.innerHTML = '00:00:00';
  }
return;
  }
  hours = 0;
  minutes = 0;
  interval = 1000;
  if (seconds >= 3600) {
hours = Math.floor(seconds/3600);
seconds = Math.floor(seconds-(3600*hours));
  }
  if (seconds >= 60) {
minutes = Math.floor(seconds/60);
seconds = Math.floor(seconds-(60*minutes));
  }

  el = document.getElementById(div_name);

  if (el) {
if (hours < 10) {
  hours = '0' + hours;
}
if (minutes < 10) {
  minutes = '0' + minutes;
}
if (seconds < 10) {
  seconds = '0' + seconds;
}
el.innerHTML = hours + ':' + minutes + ':' + seconds;
orig_seconds -= 1;
window.setTimeout("display_short_lived_counter(" + orig_seconds + ", \""
+ div_name + "\")", interval);
  }
}



$(document).ready(function(){
display_short_lived_counter(3600,'server_time2');
display_short_lived_counter(1800,'server_time3');
});


It will show countdown like this :
00:01:00
00:00:30

I wont use script php like this, so countdown depend on item on table item

$rs=mysql_query("select
TIME_TO_SEC(itm_date_expired)-TIME_TO_SEC(itm_date_start) time_diff from
item");
while ($dt=mysql_fetch_array($rs)) {
  // how can i call function  display_short_lived_counter ()
this block??
}

Thanks


[jQuery] get param from URL

2009-05-04 Thread gozigo_milis gozigo_milis
Dear all,
Can u give me script with jquery how to get URL after #
Example : index.php?p=item#id=1
How can I get id=1?

Thanks


[jQuery] Re: countdown Plugin

2009-04-29 Thread gozigo_milis gozigo_milis
Sorry my English Is Bad:)

I'm developing a web for online auction product. Each item have a different
time , it get from database depend on item
Example :
Item A => Countdown 00:00:60 ( threshold 15)
Item B => Countdown 00:00:45 ( threshold 10)
Item C => Countdown 00:00:30 ( threshold 5)

If the bidder bid item A under threshold, the time will be add 45 second and
if the other bidder bid again  the time not be added, it means max time is
60 second.

THe problem is

How do I create a script so that the Auction does not connect to the server
every second to check condition (like bidder, time, price and other) .
 Connections should be made to the server if someone bid the item,  with the
other world server doing ajax push to browser not browser to server.


Thanks



On Wed, Apr 29, 2009 at 9:36 PM, Chacha Golden  wrote:

> Could you restate that last line "If the countdown is done then the bid
> will be 30 seconds". I don't quite understand it
>
>
> On Wed, Apr 29, 2009 at 5:43 AM, gozigo_milis gozigo_milis <
> gozigomi...@gmail.com> wrote:
>
>> I'm developing a web for online auction items. Each item will have a
>> countdown such as 00:10:00 and will go down if the user does not make a bid.
>> If the countdown is done then the bid will be 30 seconds.
>>
>> The problem is:
>>
>> How do I create a script so that the Auction does not connect to the
>> server every second? Connections should be made to the server if there is to
>> do a bid.
>>
>> Thanx
>>
>
>
>
> --
> Chacha102
> One of a kind
> http://chacha102.com
> http://just102.wordpress.com
>
> We have come to something so mysterious,
> Too deep for minds to comprehend,
> Through the open doors,
> Where the angels sing,
> And the hosts of heaven are antheming.
>


[jQuery] Re: GET PARAM FROM URL WITH JQUERY

2009-04-29 Thread gozigo_milis gozigo_milis
I hava script like this
function get_param_name(){
var regexS = "([\\#][^]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.hash);
var ret;
if(results == null){
ret = "";
}else{
ret=results[0].replace("#","");
}
return ret;
}



$(document).ready(function(){
var x=get_param_name();
alert(x);
});




I run in Google Chrome it work
but in opera and IE 8 it does't work...

Any other idea?


On Wed, Apr 29, 2009 at 9:12 PM, Martijn Houtman
wrote:

>
> On Apr 29, 2009, at 2:45 PM, gozigo_milis gozigo_milis wrote:
>
>  example : http://www.matrix.com/index.php?p=gallery#page=1
>>
>> how can I get page=1 (parameter after sign #)
>>
>
> window.location.hash
>
>


[jQuery] GET PARAM FROM URL WITH JQUERY

2009-04-29 Thread gozigo_milis gozigo_milis
Hello all

I will aks sth

example : http://www.matrix.com/index.php?p=gallery#page=1


how can I get page=1 (parameter after sign #)

thanks


[jQuery] countdown Plugin

2009-04-29 Thread gozigo_milis gozigo_milis
I'm developing a web for online auction items. Each item will have a
countdown such as 00:10:00 and will go down if the user does not make a bid.
If the countdown is done then the bid will be 30 seconds.

The problem is:

How do I create a script so that the Auction does not connect to the server
every second? Connections should be made to the server if there is to do a
bid.

Thanx