|
||||||
| JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
say i have these two functions:
Code:
function one(object)
object.style.right=1px;
function two(object) {
object.style.top=1px;
}
is there a way i could reduce redundancy by combining these two functions into one by adding an extra parameter? im thinking of something like this: Code:
function three(object, direction) {
object.style.direction=1px;
}
Last edited by Jordan; 04-28-2008 at 11:58 AM. |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| new to javascript, help with reducing redundancy | mamba_namba | JavaScript and CSS | 2 | 04-27-2008 05:55 AM |
| Nortan Popup Blocker + JavaScript Issue | twalters84 | JavaScript and CSS | 3 | 03-11-2008 04:47 AM |
| PHP accessing through remotely javascript from another website | deny | Request Services (Paid) | 4 | 01-28-2008 08:02 AM |
| [Easy as Pie] Unobtrusive JavaScript | Kernel | Programming News | 0 | 12-20-2007 09:07 AM |
| Counting Files with JavaScript | Matt | JavaScript and CSS | 5 | 08-01-2007 12:02 PM |