This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

problem in paging using javascript

 
Ranch Hand
Posts: 1102
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code:




Code is working properly, but can anyone tell me is there any other way to do this, here the function is being called so many of times.
how can i do this, without calling the hide function again and again???
 
Marshal
Posts: 25189
64
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you had a "hideall" function then your code could look like this:
 
Punit Jain
Ranch Hand
Posts: 1102
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:If you had a "hideall" function then your code could look like this:



Thanks paul, but how to make this "hideall" function where as "hide" function is not same always, it somewhere depends on the "show" function, can you tell me exactly...?

 
Marshal
Posts: 67362
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it hides all, and therefore is the same each time.
 
Punit Jain
Ranch Hand
Posts: 1102
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:No, it hides all, and therefore is the same each time.



But in my query/problem i don't want to hide same div's each time, if you noticed in the code the showPage function parameter/argument is changing everytime, i m calling that function, nd along that function i want to hide all other respective div's, for that i m calling hide() again nd again, because div id's are not same always/in every calling...
 
Bear Bibeault
Marshal
Posts: 67362
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if you notice in Paul's example, the correct div is shown after hiding all... Think!
 
Punit Jain
Ranch Hand
Posts: 1102
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:And if you notice in Paul's example, the correct div is shown after hiding all... Think!




i write function like this:

function hideall()
{
for(int i=1;i<11;i++)
document.divs[i].visibility = "hidden";
}

but it's not working..
sorry if i m nt getting, i m new to js, can you tell me what should i write in hideall()..???
 
Punit Jain
Ranch Hand
Posts: 1102
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Punit Jain wrote:

Bear Bibeault wrote:And if you notice in Paul's example, the correct div is shown after hiding all... Think!




okay i done it, code is like this:




and it's working now..
Any modifications will be appreciable....
Thank you all

 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!