It is quite feasible to take a day trip to Zagreb by train. Journey time is just over 2 hours.
With the summer 09 timetable you could leave Ljubljana at 08.15 to be in Zagreb about 10.30. The
18.10 return would be your best bet. Time for a good lunch with some sightseeing either side, and back in Ljubljana for a late dinner. Check the website for current timetables (it has an English version)
My return cost me €29 in 1st class (would have been €19 in 2nd) but I was not going for the day and reductions might be available.
The station in Zagreb is ideally placed for a trip like this - right on the edge of the city centre.
Remember to take your passport - Croatia was still outside the EU when I travelled, and stringent border checks will take place.
The journey is mostly very scenic through the River Sava valley, and only becomes a little tedious as you approach Zagreb.
When visiting Ljubljana, why not have a day or 2 to reach Zagreb as well.
It's in Croatia, the country just below Slovenia. Trains would take hours only.
Zagreb is a city in some parts more lively than Ljubljana. Rich in history.
Although bad words maybe from Slovenes on Zagreb, just go there.
That's what I did although the guy at the Tourist Office was not even sure why I wanted to go there !
Please go to my Zagreb page to see more of this city.