Hi !
I'm new to the list, and to jQuery too (I've played a little with  
prototype, but jquery realy seems  worth a try)

This is an example I think, where using your own attributes gets  
useful, not to say necessary :
I'm writing a calendar where user can select a days range clicking on  
the first day of the range, then on the second one.
User can only select, say, ranges from january 24th to march 15th.
When first day is selected, I want to have the days before the first  
area change style when the second day is hover'ed

So this is how I would do this :

<div class="calendarmonth"><h3>January</h3>
        <div  class="calendarday">1</div>
        <div  class="calendarday">2</div>
        ....
        <div  class="calendarday">23</div>
        <div selectableday="1" class="calendarday">24</div>
        <div selectableday="2" class="calendarday">25</div>
        .....
        <div selectableday="41" class="calendarday">15</div>
</div>

On hover of day D2, while day D1 was selected, I just have to change  
style of the divs of class "calendarday" with selectableday attribute  
lower than D1's selectableday attribute and greater than D2's  
selectableday attribute.

Do you think of a better way, without using a custom attribute (I'm  
not 100% sure but seems like you can't use numeric classes nor id  
right ?)


Le 25 janv. 07 à 04:13, Ⓙⓐⓚⓔ a écrit :

> I gave up relying on custom doctypes when I realized no matter how
> nice a dtd I made, the only use was at the validaters! I looked around
> for syntax driven editors, and found only a few and they were schema
> based!
>
> Now I just use XHTML 1.1 and play my own tricks... with the help of  
> jquery!
>
> <h1 class="editable"> is just fine for me.
>
> On 1/24/07, zelexir <[EMAIL PROTECTED]> wrote:
>>
>> So, I had a wakeup call the other day when looking for a solution  
>> to a
>> problem of mine when I bumped into this:
>> http://www.cs.tut.fi/~jkorpela/html/own-dtd.html Creating your own  
>> DTD for
>> HTML validation .
>>
>> So I'm wondering, why this isn't more widespread.
>>
>> Now I can write code like this: <h1 editable="true">This is a  
>> topic</h1> and
>> still make validation (not for the standard but for my edited  
>> version of
>> one).
>>
>> So I made a few changes in a edit in place script I'm working on,  
>> and I
>> gotta say it makes the source much more readable.
>>
>> so instead of
>> <h1 id="topic-5-news" class="editableLine">This is the topic of news
>> nr5</h1>
>>
>> I get
>> <h1 db="news" field="topic" unique="5" editable="line">This is the  
>> topic of
>> news nr5</h1>
>>
>> Or like I'm using it:
>> <div db="news" unique="5">
>>    <h1 field="topic" editable="true">This is the topic of news  
>> nr5</h1>
>>    <div field="content" editable="true">This is a editable  
>> paragraph</div>
>> </div>
>>
>> and with jQuery I'm able to use the selectors $('h1 
>> [editable=true]') to
>> generate a <input> field and $('div[editable=true]') to generate a  
>> WYSIWYG
>> editor.
>>
>> I get the current table and unique id from checking the parent div's
>> parameters, and the field from the current element.
>>
>> Ok so this is getting a little long, but why oh why, havn't I  
>> thought of
>> this before? And whats the catch?!
>> I'ts late and I really gotta get some sleep, but I would love to  
>> hear some
>> input in this from fellow JQuery users, we do want our code to be  
>> easy to
>> read, don't we? :P
>> --
>> View this message in context: http://www.nabble.com/Giving-up- 
>> regular-DOCTYPES-tf3095989.html#a8595317
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>>
>
>
> -- 
> Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to