Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #29388 > unrolled thread

displaying specified div in order based on clicking dynamically displayed dates with jquery/javascript

Started byaetagothno@gmail.com
First post2016-01-20 19:29 -0800
Last post2016-01-22 16:38 +0100
Articles 4 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  displaying specified div in order based on clicking dynamically displayed dates with jquery/javascript aetagothno@gmail.com - 2016-01-20 19:29 -0800
    Re: displaying specified div in order based on clicking dynamically displayed dates with jquery/javascript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-22 15:12 +0100
      Re: displaying specified div in order based on clicking dynamically displayed dates with jquery/javascript Aleksandro <aleksandro@gmx.com> - 2016-01-22 11:54 -0300
        Re: displaying specified div in order based on clicking dynamically displayed dates with jquery/javascript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-22 16:38 +0100

#29388 — displaying specified div in order based on clicking dynamically displayed dates with jquery/javascript

Fromaetagothno@gmail.com
Date2016-01-20 19:29 -0800
Subjectdisplaying specified div in order based on clicking dynamically displayed dates with jquery/javascript
Message-ID<68141c33-727f-481c-9df0-3ca4e0471b7b@googlegroups.com>

Here is my code: http://js.do/jane-d0e/80399

I have predefined div's, each are going to contain different content and styles. I want to have a user enter a start date, and then restrict the end date so they can choose up to 7 days. I have been having a problem implementing the date restriction, I try doing "+7d" for max Date but for some reason it doesn't limit it correctly, it is always showing more than the amount I specify.

So say the user chooses a date range, with 7 days total. The date range appears below. If the user clicks on the first date, the content within the first div is supposed to be displayed only. The next date that is clicked the content in the second div is displayed only, and so on. So div1 maps to first date.. div7 will map to 7th date if there is a seventh date. I thought of trying to do this with next() but this did not work, now when I run the code and select a date it opens the whole set of divs for each selected date rather than the single intended div.

What is the best way to go about achieving this?

[toc] | [next] | [standalone]


#29408

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2016-01-22 15:12 +0100
Message-ID<XnsA5979AB6B13A7eejj99@194.109.6.166>
In reply to#29388
aetagothno@gmail.com wrote on 21 Jan 2016 in comp.lang.javascript:

> Here is my code: http://js.do/jane-d0e/80399

Oh please why all this JQuery, you will never learn Javascript that way.
 
> I have predefined div's, each are going to contain different content and
> styles. I want to have a user enter a start date, and then restrict the
> end date so they can choose up to 7 days. I have been having a problem
> implementing the date restriction, I try doing "+7d" for max Date but

7 days is aDate to aDate + 6 days, not + 7 days.

var aDate = 
   new Date(2016,0,22);
var lastDate =  
   new Date(aDate.getFullYear(), aDate.getMonth(), aDate.getDate() + 6);


> for some reason it doesn't limit it correctly, it is always showing more
> than the amount I specify. 

Stands to reason, see above.

> [..]

> What is the best way to go about achieving this?

Silly presumption, that there must be a "best" way,
unless perhaps it learning proper Javascript.



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#29409

FromAleksandro <aleksandro@gmx.com>
Date2016-01-22 11:54 -0300
Message-ID<n7tfmo$hmd$1@dont-email.me>
In reply to#29408
On 22/01/16 11:12, Evertjan. wrote:
> aetagothno@gmail.com wrote on 21 Jan 2016 in comp.lang.javascript:
> 
>> Here is my code: http://js.do/jane-d0e/80399
> 
> Oh please why all this JQuery, you will never learn Javascript that way.

$($(come).on(this).it($("not"), $((so.bad)) || isnt.it ? lol:lol))

[toc] | [prev] | [next] | [standalone]


#29410

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2016-01-22 16:38 +0100
Message-ID<XnsA597A9465797Deejj99@194.109.6.166>
In reply to#29409
Aleksandro <aleksandro@gmx.com> wrote on 22 Jan 2016 in comp.lang.javascript:

> On 22/01/16 11:12, Evertjan. wrote:
>> aetagothno@gmail.com wrote on 21 Jan 2016 in comp.lang.javascript:
>> 
>>> Here is my code: http://js.do/jane-d0e/80399
>> 
>> Oh please why all this JQuery, you will never learn Javascript that way.
> 
> $($(come).on(this).it($("not"), $((so.bad)) || isnt.it ? lol:lol))

If someone cannot count 7 days in Javascript,
trying to do it in JQuery, well ...

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web