Bug Tracker

Modify

Ticket #7660 (closed feature: wontfix)

Opened 2 years ago

Last modified 2 years ago

jQuery.support.minWidth

Reported by: Leonid Bayda <leonid.baida@…> Owned by:
Priority: low Milestone: 1.6
Component: support Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

It was necessary for me in my project to know does browser support minWidth or not. So I added this checking to $.support. It would be nice to see this feature in next release of jQuery.

/* jQuery.support.minWidth */
$(function() {
        var 
                table = document.createElement('table'),
                tr = table.appendChild(tr = document.createElement('tr')),
                td = tr.appendChild(td = document.createElement('td'));

        table.cellPadding = 0;
        table.cellSpacing = 0;

        td.innerHTML = '<div style="min-width: 150px;">';

        document.body.appendChild(table);

        $.support.minWidth = table.offsetWidth === 150;

        document.body.removeChild(table).style.display = "none";
        
        table = tr = td = null;
});

Thanks!

Change History

comment:1 Changed 2 years ago by jitter

  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from new to closed
  • Component changed from unfiled to support

Thanks for taking the time to contribute to the jQuery project by suggesting a new feature.

But I think this isn't going to be included in jQuery core. The docs for  jQuery.support already explain why.

While jQuery includes a number of properties, developers should feel free to add their own as their needs dictate. [...] Since jQuery requires these tests internally, they must be performed on every page load; for that reason this list is kept short and limited to features needed by jQuery itself.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.