In essence, it works the same way in Slovenia. The only difference is that there are shorter-duration vignettes available. A 7-day vignette costs €15, a 30-day vignette costs €30.
You can buy one at gas stations and kiosks in Slovenia and in neighbouring countries, too. For example, if you'll be driving there via the Italian A4 autostrada, most service areas after Venice will have the Slovenian vignette in stock. You can also buy it at the border crossing (there is a gas station or other point of sale there), but if you cross on the motorway that is your last resort. After that, you are liable for a steep fine. On non-motorway crossings you can safely drive into the country and stop at the first gas station. Like in Switzerland, you won't need one if you don't enter the motorway. Note that there is no control on the Slovenian-Italian or Slovenian-Austrian border, so there will be no one to direct you to the vignette point of sale, you must do it on your own.
If you'll be driving through Austria, you may need an Austrian vignette, too.